Re: Exceptions in IPC::Open2
[p5sagit/p5-mst-13.2.git] / configure.com
CommitLineData
97abc6ad 1$ sav_ver = 'F$VERIFY(0)'
2$! SET VERIFY
3$!
4$! Installation and usage: COPY this file into you perl source tree - at or
5$! below where the main MANIFEST. file is located.
6$!
7$! For example, if you unpacked perl into: [USER.PERL5_00n...] then you will
8$! want to:
9$!
10$! $ COPY Configure.com [USER.PERL5_00n.VMS]
11$!
12$! Now cd into the tree and execute Configure:
13$!
14$! $ SET DEFAULT [USER.PERL5_00n]
15$! $ @[.vms]Configure
16$!
17$! or
18$!
19$! $ SET DEFAULT [USER.PERL5_00n]
20$! $ @[.vms]Configure "-des"
21$!
22$! That's it. If you get into a bind trying to build perl on VMS then
23$! definitely read through the README.VMS file as well as the top of the
24$! [.VMS]DESCRIP.MMS file.
25$! Beyond that send email to VMSPerl@cor.newman.upenn.edu
26$!
27$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
28$!
29$! This CONFIGURE.COM prototype is available from:
30$! http://w4.lns.cornell.edu/~pvhp/perl/vms/devel/configure.com
31$! send suggestions to:
32$! Peter Prymmer pvhp@lns62.lns.cornell.edu or pvhp@forte.com
33$! Thank you!!!!
34$!
35$! Adapted and converted from Larry Wall & Andy Dougherty's
36$! "Configure generated by metaconfig 3.0 PL60."
37$! (a Bourne sh[ell] script for configuring the installation of perl on VMS)
38$! in the perl5.002|3 epoch (spring/summer 1996)
39$! with much valuable help from Charles Bailey &
40$! the whole VMSPerl crew.
41$!
42$! SET NOVERIFY
43$ sav_ver = F$VERIFY(sav_ver)
44$!
45$! VMS-isms we will need:
46$ echo = "write sys$output "
47$ cat = "type"
48$ gcc_symbol = "gcc"
49$ ans = ""
50$ macros = ""
51$ C_Compiler_Replace = "CC="
52$ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
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]
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.
387$ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
388$ THEN
389$ TYPE SYS$INPUT:
390%Config-E-VMS, ERROR:
391 Sorry! It apears as though your perl build sub-directory is already too
392 deep into the VMS file system. Please try moving stuff into a shallower
393 directory (or altering the "max_allowed_dir_depth" parameter).
394$ echo4 "ABORTING..."
395$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
396$ STOP
397$ EXIT !2 !$STATUS = "%X00000002" (error)
398$ ENDIF
399$!
400$! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
401$!
402$ IF (manifestfound .NES. "")
403$ THEN
404$ IF ( F$SEARCH("UU.DIR").EQS."" )
405$ THEN
406$ CREATE/DIRECTORY [.UU]
407$ ELSE
408$ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
409$ ENDIF
410$!: Configure runs within the UU subdirectory
411$ SET DEFAULT [.UU]
412$!
413$! a little redundancy never hurt anybody?
414$ file_2_find = "[-]" + file_2_find
415$ manifestfound = F$SEARCH(file_2_find)
416$!
417$ OPEN/WRITE MISSING MISSING.
418$!change to "FALSE" if you wish to skip the manifest search
419$!(which after all is rather slow in DCL :-)
420$ IF ("TRUE")
421$ THEN
422$ OPEN/READ CONFIG 'manifestfound'
423$Read_loop_manifest:
424$ READ/END_OF_FILE = Done_manifest CONFIG line
425$! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
426$! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
427$! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
428$! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
429$ line = F$EDIT(line,"TRIM, COMPRESS")
430$ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
431$ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
432$ THEN
433$Re_strip_line_manifest:
434$ loca = F$LOCATE("/",file_2_find)
435$ ante = F$EXTRACT(0,loca,file_2_find)
436$ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
437$ test_this = ante + "." + (post - "/")
438$ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
439$ THEN
440$ file_2_find = ante + "." + (post - "/")
441$ GOTO Re_strip_line_manifest
442$ ELSE
443$ file_2_find = ante + "]" + (post - "/")
444$ ENDIF
445$ file_2_find = "[-."+file_2_find
446$ ELSE
447$ file_2_find = "[-]" + file_2_find
448$ ENDIF
449$!
450$ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
451$ file_2_find = file_2_find - dirname
452$ dots = 0
453$Dot_loop:
454$ dot_ele = F$ELEMENT(dots,".",file_2_find)
455$ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
456$ IF dots .eq. 0
457$ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
458$ ELSE basename = basename + dot_ele + "_"
459$ ENDIF
460$ dots = dots + 1
461$ GOTO dot_loop
462$Eo_dot_loop:
463$ IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
464 (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
465 basename = f$extract(0,f$length(basename)-1,basename)
466$ file_2_find = dirname + basename
467$!
468$ found = F$SEARCH(file_2_find)
469$ IF (found .EQS. "")
470$ THEN
471$ WRITE MISSING file_2_find
472$ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
473$ THEN
474$ miss_list = miss_list + "," + file_2_find
475$ ENDIF
476$ ENDIF
477$ GOTO Read_loop_manifest
478$Done_manifest:
479$ CLOSE CONFIG
480$ ENDIF !"TRUE"
481$ CLOSE MISSING
482$ ENDIF ! (manifestfound .NES. "")
483$Beyond_manifest:
484$ IF (miss_list .NES. "")
485$ THEN
486$ echo "Some of the files not found include:"
487$ cat4 MISSING.
488$ ENDIF
489$ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
490$ THEN
491$ TYPE SYS$INPUT:
492
493THIS PACKAGE SEEMS TO BE INCOMPLETE.
494
495You have the option of continuing the configuration process, despite the
496distinct possibility that your kit is damaged, by typing 'y'es. If you
497do, don't blame me if something goes wrong. I advise you to type 'n'o
498and contact the author (pvhp@lns62.lns.cornell.edu).
499
500$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
501$ IF ans
502$ THEN
503$ echo4 "Continuing..."
504$ ELSE
505$ echo4 "ABORTING..."
506$ GOTO Clean_up
507$ ENDIF
508$ ELSE
509$ echo4 "Looks good..."
510$ DELETE/NOLOG MISSING.;
511$ ENDIF ! (miss_list .NES. "")
512$ ENDIF ! (manifestfound .EQS. "") ELSE
513$!
514$! after finding MANIFEST (see above)
515$!: Configure runs within the UU subdirectory
516$!
517$!: compute the number of columns on the terminal for proper question formatting
518$! (sfn, will assume 80-ish)
519$!
520$!: set up the echo used in my read !sfn
521$!: now set up to do reads with possible shell escape and default assignment !sfn
522$ GOTO Beyond_myread
523$!
524$myread:
525$ ans = ""
526$ If (fastread)
527$ Then
528$ echo4 "''rp'"
529$ Else
530$ If (silent)
531$ Then
532$ READ SYS$COMMAND/PROMPT="''rp'" ans
533$ Else
534$ echo ""
535$ READ SYS$COMMAND/PROMPT="''rp'" ans
536$ Endif
537$ Endif
538$ RETURN
539$!
540$Beyond_myread:
541$!
542$!: create .config dir to save info across Configure sessions
543$ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
544$ THEN
545$ CREATE/DIRECTORY [-.CONFIG]
546$ OPEN/WRITE CONFIG [-.CONFIG]README.
547$ WRITE CONFIG -
548 "This directory created by Configure to save information that should"
549$ WRITE CONFIG -
550 "persist across sessions."
551$ WRITE CONFIG ""
552$ WRITE CONFIG -
553 "You may safely delete it if you wish."
554$ CLOSE CONFIG
555$ ENDIF
556$!
557$!: general instructions
558$ needman = "true"
559$ firsttime = "true"
560$ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
561$ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
562$ THEN
563$ messages = F$ENVIRONMENT("MESSAGE")
564$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
565$ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
566$ IF .NOT.($status.EQ.%X08D78053)
567$ THEN
568$ firsttime=""
569$ dflt = "n"
570$ rp = "Would you like to see the instructions? [''dflt'] "
571$ GOSUB myread
572$ if .NOT.ans THEN needman=""
573$ ENDIF
574$ SET MESSAGE 'messages' !hope you made it here :-)
575$ ENDIF
576$ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
577$!
578$ IF (needman)
579$ THEN
580$ TYPE SYS$INPUT:
581
582This installation shell script will examine your system and ask you questions
583to determine how the perl5 package should be installed. If you get
584stuck on a question, you may use a ^C or ^Y shell escape to STOP this
585process, edit something, then restart this process as you just did.
586Many of the questions will have default answers in square
587brackets; typing carriage return will give you the default.
588
589$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
590$ TYPE SYS$INPUT:
591
592In a hurry? You may run '@Configure -d'. This will bypass nearly all
593the questions and use the computed defaults (or the previous answers provided
594there was already a config.sh file). Type '@Configure -h' for a list of
595options.
596
597$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
598$ TYPE SYS$INPUT:
599
600Much effort has been expended to ensure that this shell script will
601run on any VMS system. If despite that it blows up on yours, your
602best bet is to edit Configure.com and @ it again. Whatever problems
603you have with Configure.com, let me (sugalskd@ous.edu) know how I blew
604it.
605
606$!This installation script affects things in two ways:
607$!
608$!1) it may do direct variable substitutions on some of the files included
609$! in this kit.
610$!2) it builds a config.h file for inclusion in C programs. You may edit
611$! any of these files as the need arises after running this script.
612$!
613$!If you make a mistake on a question, there is no easy way to back up to it
614$!currently.
615$!
616$ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
617$ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
618$ THEN
619$ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
620$ WRITE CONFIG user
621$ CLOSE CONFIG
622$ ENDIF
623$ ENDIF !(needman .EQS. "true")
624$!
625$!: see if sh knows # comments !sfn
626$ sharpbang = "$ "
627$!: figure out how to guarantee sh startup !sfn
628$!: find out where common programs are !sfn
629$!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
630$!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
631$! echo "I don't know where '$file' is, and my life depends on it."
632$! echo "Go find a public domain implementation or fix your PATH setting!"
633$! echo ""
634$! echo "Don't worry if any of the following aren't found..."
635$!: determine whether symbolic links are supported !sfn
636$!: see whether [:lower:] and [:upper:] are supported character classes !sfn
637$!: set up the translation script tr, must be called with ./tr of course !sfn
638$!
639$!: Try to determine whether config.sh was made on this system
640$!: Get old answers from old config file if Configure was run on the
641$!: same system, otherwise use the hints.
642$ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
643$ i = 0
644$ max = 3
645$Config_sh_look:
646$ config_sh = F$ELEMENT(i,"/",config_sh_es)
647$ i = i + 1
648$ IF (config_sh.NES."/").AND.(config_sh.NES."")
649$ THEN
650$ configshfound = F$SEARCH(config_sh)
651$ IF (configshfound.NES."") THEN GOTO Config_sh_found
652$ ENDIF
653$ IF (i.LT.max) THEN GOTO Config_sh_look
654$ IF (configshfound.EQS."") THEN GOTO Beyond_config_sh
655$Config_sh_found:
656$ echo ""
657$ echo "Fetching default answers from ''config_sh'..."
658$!we actually do not have "hints/" for VMS
659$! TYPE SYS$INPUT:
660$!
661$!First time through, eh? I have some defaults handy for the following systems:
662$!
663$! echo " ","VMS_VAX"
664$! echo " ","VMS_AXP"
665$! : Now look for a hint file osname_osvers, unless one has been
666$! : specified already.
667$! TYPE SYS$INPUT:
668$!
669$!You may give one or more space-separated answers, or "none" if appropriate.
670$!If your OS version has no hints, DO NOT give a wrong version -- say "none".
671$!
672$! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
673$!
674$Beyond_config_sh:
675$!
676$!: Restore computed paths !sfn
677$!
678$! genconfig.pl has "osname='VMS'"
679$ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
680$! %Config-I-VMS, a necessary error trap (could be PC running VCL)
681$!
682$ IF (osname .NES. "VMS")
683$ THEN
684$ echo4 "Hmm.. I wonder what ''osname' is (?)"
685$ TYPE SYS$INPUT:
686
687%Config-E-VMS, ERROR:
688
689 Err, you do not appear to be running VMS!
690 This package is intended to Configure the building of Perl for VMS.
691
692$ READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
693$ IF ans
694$ THEN
695$ echo4 "Continuing..."
696$ ELSE
697$ echo4 "ABORTING..."
698$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
699$ STOP
700$ EXIT 2 !$STATUS = "%X00000002" (error)
701$ ENDIF
702$ ELSE !we are on VMS huzzah!
703$ IF .NOT.silent
704$ THEN TYPE SYS$INPUT:
705
706Configure uses the operating system name and version to set some defaults.
707The default value is probably right if the name rings a bell. Otherwise,
708since spelling matters for me, either accept the default or answer "none"
709to leave it blank.
710$ ENDIF
711$ rp = "Operating system name? [''osname'] "
712$ GOSUB myread
713$ IF ans.nes.""
714$ THEN
715$ IF (ans.NES.osname) !.AND.knowitall
716$ THEN
717$ echo4 "I'll go with ''osname' anyway..."
718$ ENDIF
719$ ENDIF
720$ ENDIF !(osname .NES./.EQS. "VMS")
721$!
722$!: who configured the system
723$! see 'user' above.
724$ cf_by = F$EDIT(user,"LOWERCASE")
725$! cf_time = F$CVTIME() !superceded by procedure below
726$ osvers = F$GETSYI("VERSION")
727$!
728$! Peter Prymmer has seen:
729$! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
730$! "SYS$TIME_ZONE" = "EDT"
731$!
732$! Charles Lane recommended:
733$! "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
734$! "NEWS_TIMEZONE" = "-0500"
735$! "ST_TIMEZONE" = "EDT"
736$! "JAN_TIME_ZONE" = "EST "
737$! "MULTINET_TIMEZONE" = "EST"
738$! "DAYLIGHT_SAVINGS" = "1"
739$!
740$! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
741$! "PMDF_Timezone"
742$! "Multinet_Timezone"
743$! "TCPware_Timezone"
744$! "WIN$Time_Zone"
745$!
746$! This snippet o' DCL returns a string in default Unix `date` format,
747$! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
748$! Peter Prymmer pvhp@lns62.lns.cornell.edu
749$!
750$ MIN_TZO = -840 !units are minutes here
751$ MAX_TZO = 840
752$!
753$ wkday = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
754$ monn = F$CVTIME(,,"MONTH")
755$ mday = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
756$ hour = F$CVTIME(,,"HOUR")
757$ min = F$CVTIME(,,"MINUTE")
758$ sec = F$CVTIME(,,"SECOND")
759$ year = F$CVTIME(,,"YEAR")
760$!
761$ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
762$ i = 0
763$Mon_loop:
764$ i = i + 1
765$ mon = F$ELEMENT(i,"/",months)
766$ IF i.LT.monn THEN GOTO Mon_loop
767$!
768$ tzneedset = "t"
769$ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
770$ IF systz.NES.""
771$ THEN
772$ tzhour = F$INTEGER(systz)/3600
773$ tzmins = F$INTEGER(systz)/60
774$ tzminrem = tzmins - tzhour*60
775$ IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem !keeps !2ZL happy
776$ IF tzhour.ge.0
777$ THEN signothetime = "+"
778$ IF tzhour.EQ.0.AND.tzminrem.EQ.0
779$ THEN direction = "on GMT/"
780$ ELSE direction = "east of "
781$ ENDIF
782$ ELSE signothetime = "-"
783$ tzhour = -1*tzhour !keeps !UL happy
784$ direction = "west of "
785$ ENDIF
786$ echo ""
787$ echo "%Config-I-VMS,"
788$ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
789$ IF tzminrem.ne.0
790$ THEN
791$ tzspan = "''tzhour' hours & ''tzminrem' minutes"
792$ ELSE
793$ tzspan = "''tzhour' hours"
794$ ENDIF
795$ dflt = "y"
796$ echo "Your system is ''tzspan' ''direction'UTC in England."
797$ rp = "%Config-I-VMS, (''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
798$ GOSUB myread
799$ IF ans.OR.(ans.EQS."")
800$ THEN
801$ tzneedset = "f"
802$ tzd = systz
803$ GOTO Beyond_TimeZone
804$ ENDIF
805$ ELSE
806$ echo ""
807$ echo4 "%Config-I-VMS,"
808$ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
809$ ENDIF
810$!
811$TZSet:
812$ echo ""
813$ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
814$ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
815$ echo "Eastern Daylight Time (summer) is -4:00 offset."
816$ dflt = "0:00"
817$ rp = "Enter the Time Zone offset: [''dflt'] "
818$ GOSUB myread
819$ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
820$ IF ans.EQS."" THEN ans = dflt
821$ tzhour = F$ELEMENT(0,":","''ans'") !first
822$ IF tzhour.EQS."" THEN tzhour = 0
823$ tzhour = F$INTEGER(tzhour)
824$ tzminrem = F$ELEMENT(1,":","''ans'") !second
825$ IF tzminrem.NES.""
826$ THEN
827$ tzminrem = F$INTEGER(tzminrem)
828$ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
829$ ELSE
830$ tzminrem = 0
831$ ENDIF
832$ tzmins = tzhour*60 + tzminrem
833$ tzd = F$STRING(tzmins*60)
834$ IF tzhour .GE. 0
835$ THEN
836$ signothetime = "+"
837$ ELSE
838$ tzhour = -1*tzhour !keeps !UL happy
839$ signothetime = "-"
840$ ENDIF
841$ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
842$ THEN
843$ echo ""
844$ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
845$ goto TZSet
846$ ENDIF
847$!
848$Beyond_TimeZone:
849$ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
850$ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
851$!
852$!: determine the architecture name
853$! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
854$!
855$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
856$ THEN
857$ archname = "VMS_VAX"
858$ ELSE
859$ archname = "VMS_AXP"
860$ ENDIF
861$ rp = "What is your architecture name? [''archname'] "
862$ GOSUB myread
863$ IF ans.NES.""
864$ THEN
865$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
866$ IF (ans.NES.archname) !.AND.knowitall
867$ THEN
868$ echo4 "I'll go with ''archname' anyway..."
869$ ENDIF
870$ ENDIF
871$ IF (archname.EQS."VMS_AXP")
872$ THEN
873$ dflt = "N"
874$ rp = "Are you sharing your PERL_ROOT with a VAX? [''dflt'] "
875$ GOSUB myread
876$ if ans.NES.""
877$ THEN
878$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
879$ ENDIF
880$ IF (ans.NES."Y")
881$ THEN
882$ sharedperl = "N"
883$ ELSE
884$ sharedperl = "Y"
885$ macros = macros + """AXE=1"","
886$ ENDIF
887$ ELSE
888$ sharedperl = "N"
889$ ENDIF
890$!
891$!: is AFS running? !sfn
892$!: decide how portable to be. Allow command line overrides. !sfn
893$!: set up shell script to do ~ expansion !sfn
894$!: expand filename !sfn
895$!: now set up to get a file name !sfn
896$!
897$ vms_skip_install = "true"
898$ dflt = "y"
899$! echo ""
900$ rp = "%Config-I-VMS, Do you wish to skip the """"where install"""" questions? [''dflt'] "
901$ GOSUB myread
902$ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
903$ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
904$ prefix = f$parse(prefix,,,,"NO_CONCEAL") - "][" - ".;"
905$ prefix = prefix - "]" + ".]"
906$ IF (.NOT.vms_skip_install)
907$ THEN
908$!: determine root of directory hierarchy where package will be installed.
909$ dflt = "default"
910$ IF .NOT.silent
911$ THEN
912$ echo ""
913$ echo "By default, ''package' will be installed in ''dflt'/bin, manual"
914$ echo "pages under ''dflt'/man, etc..., i.e. with ''dflt' as prefix for"
915$ echo "all installation directories. Typically set to /usr/local, but you"
916$ echo "may choose /usr if you wish to install ''package' among your system
917$ ENDIF
918$ IF .NOT.silent
919$ THEN TYPE SYS$INPUT:
920binaries. If you wish to have binaries under /bin but manual pages
921under /usr/local/man, that's ok: you will be prompted separately
922for each of the installation directories, the prefix being only used
923to set the defaults.
924$ ENDIF
925$ dflt = prefix
926$ rp = "Installation prefix to use? [ ''dflt' ] "
927$ GOSUB myread
928$ IF ans.NES.""
929$ THEN
930$ prefix = ans
931$ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
932$ ELSE
933$ prefix = dflt
934$ ENDIF
935$!
936$!: set the prefixit variable, to compute a suitable default value
937$!
938$!: determine where private library files go
939$!: Usual default is /usr/local/lib/perl5. Also allow things like
940$!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
941$ IF .NOT.silent
942$ THEN TYPE SYS$INPUT:
943
944There are some auxiliary files for perl5 that need to be put into a
945private library directory that is accessible by everyone.
946$ ENDIF
947$ dflt = prefix - ".]" + ".LIB]"
948$ rp = "Pathname where the private library files will reside? "
949$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
950$ GOSUB myread
951$ IF ans.NES.""
952$ THEN privlib = ans
953$ ELSE privlib = dflt
954$ ENDIF
955$!
956$ ENDIF !%Config-I-VMS, skip "where install" questions
957$!
958$!: set the base revision
959$ baserev="5.0"
960$!: get the patchlevel
961$ echo ""
962$ echo4 "Getting the current patchlevel..." !>&4
963$ patchlevel_h = F$SEARCH("[-]patchlevel.h")
964$ IF (patchlevel_h.NES."")
965$ THEN
966$ got_patch = "false"
967$ got_sub = "false"
968$ OPEN/READONLY CONFIG 'patchlevel_h'
969$Patchlevel_h_loop:
970$ READ/END_Of_File=Close_patch CONFIG line
971$ IF ((F$LOCATE("#define PATCHLEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
972$ THEN
973$ line = F$EDIT(line,"COMPRESS, TRIM")
974$ patchlevel = F$EXTRACT(18,F$LENGTH(line)-18,line)
975$ got_patch = "true"
976$ ENDIF
977$ IF ((F$LOCATE("SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
978$ THEN
979$ line = F$EDIT(line,"COMPRESS, TRIM")
980$ subversion = F$EXTRACT(18,F$LENGTH(line)-18,line)
981$ got_sub = "true"
982$ ENDIF
983$ IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
984$Close_patch:
985$ CLOSE CONFIG
986$ ELSE
987$ patchlevel="0"
988$ subversion="0"
989$ ENDIF
990$ echo "(You have ''package' ''baserev' PL''patchlevel' sub''subversion'.)"
991$! This whole thing needs replacing w/ F$FAO() calls:
992$ patchlevel = F$INTEGER(patchlevel)
993$ IF patchlevel.LT.10
994$ THEN patchlevel = "00" + F$STRING(patchlevel)
995$ ELSE patchlevel = "0" + F$STRING(patchlevel)
996$ ENDIF
997$ subversion = F$INTEGER(subversion)
998$ IF subversion.GT.0
999$ THEN
1000$ IF subversion.LT.10
1001$ THEN subversion = "0" + F$STRING(subversion)
1002$ ELSE subversion = F$STRING(subversion)
1003$ ENDIF
1004$ ELSE subversion = ""
1005$ ENDIF
1006$!
1007$ version = F$EXTRACT(0,1,baserev) + "_" + patchlevel + subversion
1008$!
1009$ IF (.NOT.vms_skip_install)
1010$ THEN
1011$!: set the prefixup variable, to restore leading tilda escape !sfn
1012$!: set the prefixup variable, to restore leading tilde escape !sfn
1013$!
1014$!: determine where public architecture dependent libraries go
1015$ IF (.NOT.silent)
1016$ THEN
1017$ echo ""
1018$ echo "''package' contains architecture-dependent library files. If you are"
1019$ ENDIF
1020$ IF (.NOT.silent)
1021$ THEN TYPE SYS$INPUT:
1022sharing libraries in a heterogeneous environment, you might store
1023these files in a separate location. Otherwise, you can just include
1024them with the rest of the public library files.
1025$ ENDIF
1026$ dflt = privlib - "]" + "." + archname + "." + version + "]"
1027$ rp = "Where do you want to put the public architecture-dependent libraries? "
1028$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1029$ GOSUB myread
1030$ IF ans.NES.""
1031$ THEN archlib = ans
1032$ ELSE archlib = dflt
1033$ ENDIF
1034$!
1035$!: set up the script used to warn in case of inconsistency !sfn
1036$!: function used to set $1 to $val !sfn
1037$!
1038$ ENDIF !%Config-I-VMS, skip "where install" questions
1039$! This quotation from Configure has to be included on VMS:
1040$ TYPE SYS$INPUT:
1041
1042There is, however, a strange, musty smell in the air that reminds me of
1043something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1044$ CONTINUE
1045$ IF (.NOT.vms_skip_install)
1046$ THEN
1047$!: it so happens the Eunice I know will not run shell scripts in Unix format
1048$!
1049$!: see if setuid scripts can be secure !sfn
1050$!: now see if they want to do setuid emulation !sfn
1051$!
1052$!: determine where site specific libraries go.
1053$ IF .NOT.silent
1054$ THEN TYPE SYS$INPUT:
1055
1056The installation process will also create a directory for
1057site-specific extensions and modules. Some users find it convenient
1058to place all local files in this directory rather than in the main
1059distribution directory.
1060$ ENDIF
1061$ dflt = privlib - "]" + ".SITE_PERL]"
1062$ rp = "Pathname for the site-specific library files? "
1063$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1064$ GOSUB myread
1065$ IF ans.NES.""
1066$ THEN sitelib = ans
1067$ ELSE sitelib = dflt
1068$ ENDIF
1069$!
1070$!: determine where site specific architecture-dependent libraries go.
1071$ IF .NOT.silent
1072$ THEN TYPE SYS$INPUT:
1073
1074The installation process will also create a directory for
1075architecture-dependent site-specific extensions and modules.
1076$ ENDIF
1077$ dflt = sitelib - "]" + "." + archname + "]"
1078$ rp = "Pathname for the site-specific architecture-dependent library files? "
1079$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1080$ GOSUB myread
1081$ IF ans.NES.""
1082$ THEN sitearch = ans
1083$ ELSE sitearch = dflt
1084$ ENDIF
1085$!
1086$!: determine where old public architecture dependent libraries might be
1087$!
1088$!: determine where public executables go
1089$ dflt = prefix - ".]" + ".BIN]"
1090$ rp = "Pathname where the public executables will reside? "
1091$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1092$ GOSUB myread
1093$ IF ans.NES.""
1094$ THEN bin = ans
1095$ ELSE bin = dflt
1096$ ENDIF
1097$!
1098$!: determine where manual pages are on this system
1099$!: What suffix to use on installed man pages
1100$!: see if we can have long filenames
1101$!: determine where library module manual pages go
1102$!: What suffix to use on installed man pages
1103$!: see what memory models we can support
1104$!
1105$ ENDIF !%Config-I-VMS, skip "where install" questions
1106$!
1107$!: see if we need a special compiler
1108$! cc_list = "cc/vaxc|cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1109$!
1110$ nocc = "f"
1111$ vms_cc_dflt = ""
1112$ vms_cc_available = ""
1113$!
1114$ OPEN/WRITE CONFIG ccvms.c
1115$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1116$ WRITE CONFIG "#include <stdio.h>"
1117$ WRITE CONFIG "int main() {"
1118$ WRITE CONFIG "#ifdef __DECC"
1119$ WRITE CONFIG " printf(""/DECC\n"");"
1120$ WRITE CONFIG "#else"
1121$ WRITE CONFIG " printf(""/VAXC\n"");"
1122$ WRITE CONFIG "#endif"
1123$ WRITE CONFIG " exit(0);"
1124$ WRITE CONFIG "}"
1125$ CLOSE CONFIG
1126$!
1127$ DEFINE SYS$ERROR _NLA0:
1128$ DEFINE SYS$OUTPUT _NLA0:
1129$ cc/NoObj/list=ccvms.lis ccvms.c
1130$ tmp = $status
1131$ DEASSIGN SYS$OUTPUT
1132$ DEASSIGN SYS$ERROR
1133$ IF (silent) THEN GOSUB Shut_up
1134$! echo "%Config-I-VMS, After cc compile $status = >''tmp'<" !diagnostic
1135$!
1136$ IF tmp.NE.%X10B90001
1137$ THEN
1138$ IF tmp.NE.%X10000001
1139$ THEN
1140$ nocc = "t" !%X10000001 is return from gcc
1141$ GOTO Gcc_initial_check
1142$ ENDIF
1143$ ENDIF
1144$!
1145$ GOSUB List_Parse
1146$ IF .NOT.silent THEN echo ""
1147$ echo "%Config-I-VMS, Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1148$ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1149$ THEN
1150$ vms_cc_dflt = "/vaxc"
1151$ vms_cc_available = vms_cc_available + "cc/vaxc "
1152$ IF .NOT.silent
1153$ THEN
1154$ echo "%Config-I-VMS, Will try cc/decc..."
1155$ ENDIF
1156$ DEFINE SYS$ERROR _NLA0:
1157$ DEFINE SYS$OUTPUT _NLA0:
1158$ SET NOON
1159$ cc/decc/NoObj/list=ccvms.lis ccvms.c
1160$ tmp = $status
1161$ DEASSIGN SYS$OUTPUT
1162$ DEASSIGN SYS$ERROR
1163$ SET ON
1164$ IF (silent) THEN GOSUB Shut_up
1165$ IF tmp.NE.%X10B90001
1166$ THEN
1167$ echo "%Config-I-VMS, Apparently you don't have that one."
1168$ ELSE
1169$ GOSUB List_parse
1170$ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1171$ vms_cc_available = vms_cc_available + "cc/decc "
1172$ ENDIF
1173$ ELSE
1174$ IF F$LOCATE("DEC",line).NE.F$LENGTH(line)
1175$ THEN
1176$ vms_cc_dflt = "/decc"
1177$ vms_cc_available = vms_cc_available + "cc/decc "
1178$ echo "%Config-I-VMS, Will try cc/vaxc..."
1179$ DEFINE SYS$ERROR _NLA0:
1180$ DEFINE SYS$OUTPUT _NLA0:
1181$ SET NOON
1182$ cc/vaxc/NoObj/list=ccvms.lis ccvms.c
1183$ tmp = $status
1184$ DEASSIGN SYS$OUTPUT
1185$ DEASSIGN SYS$ERROR
1186$ SET ON
1187$ IF (silent) THEN GOSUB Shut_up
1188$ IF tmp.NE.%X10B90001
1189$ THEN
1190$ echo "%Config-I-VMS, Apparently you don't have that one."
1191$ ELSE
1192$ GOSUB List_parse
1193$ echo "%Config-I-VMS, You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1194$ vms_cc_available = vms_cc_available + "cc/vaxc "
1195$ ENDIF
1196$ ENDIF
1197$ ENDIF
1198$!
1199$Gcc_initial_check:
1200$ echo "%Config-I-VMS, Checking for Gcc"
1201$ OPEN/WRITE CONFIG gccvers.lis
1202$ DEFINE SYS$ERROR CONFIG
1203$ DEFINE SYS$OUTPUT CONFIG
1204$ 'gcc_symbol'/noobj/version _nla0:
1205$ tmp = $status
1206$ DEASSIGN SYS$OUTPUT
1207$ DEASSIGN SYS$ERROR
1208$ IF (silent) THEN GOSUB Shut_up
1209$ CLOSE CONFIG
1210$ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1211$ THEN
1212$ echo "%Config-I-VMS, Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1213$ goto cc_cleanup
1214$ ENDIF
1215$ OPEN/READ CONFIG gccvers.lis
1216$GCC_List_Read:
1217$ READ/END_OF_FILE=GCC_List_End CONFIG line
1218$ GOTO GCC_List_Read
1219$GCC_List_End:
1220$ CLOSE CONFIG
1221$ echo line
1222$ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1223$ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1224$!
1225$CC_Cleanup:
1226$ DELETE/NOLOG/NOCONFIRM ccvms.*;
1227$CC_Desired:
1228$!: see if we need a special compiler
1229$! echo ""
1230$ echo "%Config-I-VMS, available compiler(s):"
1231$ echo "( ''vms_cc_available')"
1232$ IF .NOT.nocc
1233$ THEN
1234$ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1235$ ELSE
1236$ dflt = gcc_symbol
1237$ ENDIF
1238$ rp = "Use which C compiler? [''dflt'] "
1239$ GOSUB myread
1240$ IF ans.NES.""
1241$ THEN
1242$ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1243$ Mcc = ans
1244$ IF F$LOCATE("dec",ans).NE.F$LENGTH(ans)
1245$ THEN
1246$ Mcc = "cc/decc"
1247$ Using_Dec_C = "Yes"
1248$ ENDIF
1249$ IF F$LOCATE("vax",ans).NE.F$LENGTH(ans)
1250$ THEN
1251$ Mcc = "cc/vaxc"
1252$ Using_Vax_C = "Yes"
1253$ ENDIF
1254$ IF Mcc.NES.dflt
1255$ THEN
1256$ IF F$LOCATE("dec",dflt).NE.F$LENGTH(dflt)
1257$ THEN
1258$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1259$ ELSE
1260$ Using_Dec_C = "Yes"
1261$ IF F$LOCATE("vax",dflt).NE.F$LENGTH(dflt)
1262$ THEN
1263$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1264$ ENDIF
1265$ ENDIF
1266$ ELSE
1267$ IF Mcc .EQS. "cc/decc"
1268$ THEN
1269$ Using_Dec_C = "Yes"
1270$ ENDIF
1271$ ENDIF
1272$ ELSE
1273$ Mcc = dflt
1274$ IF Mcc .EQS. "cc/decc"
1275$ THEN
1276$ Using_Dec_C = "Yes"
1277$ ENDIF
1278$ IF Mcc .EQS. "cc/vaxc"
1279$ THEN
1280$ Using_Vax_C = "Yes"
1281$ ENDIF
1282$ IF Mcc .EQS. "gcc"
1283$ THEN
1284$ Using_Gnu_C = "Yes"
1285$ ENDIF
1286$ ENDIF
1287$Decc_Version_check:
1288$ IF "''Using_Dec_C'".EQS."Yes"
1289$ THEN
1290$ echo ""
1291$ echo4 "Checking for Dec C's version number..." !>&4
1292$ OPEN/WRITE CONFIG deccvers.c
1293$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1294$ WRITE CONFIG "#include <stdio.h>"
1295$ WRITE CONFIG "int main() {"
1296$ WRITE CONFIG "#ifdef __DECC"
1297$ WRITE CONFIG "#ifdef __DECC_VER"
1298$ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1299$ WRITE CONFIG "#else"
1300$ WRITE CONFIG " printf(""%i\n"", ""1"");"
1301$ WRITE CONFIG "#endif"
1302$ WRITE CONFIG "#endif"
1303$ WRITE CONFIG " exit(0);"
1304$ WRITE CONFIG "}"
1305$ CLOSE CONFIG
1306$ DEFINE SYS$ERROR _NLA0:
1307$ DEFINE SYS$OUTPUT _NLA0:
1308$ 'Mcc' deccvers.c
1309$ tmp = $status
1310$ DEASSIGN SYS$ERROR _NLA0:
1311$ DEASSIGN SYS$OUTPUT _NLA0:
1312$ IF (silent) THEN GOSUB Shut_up
1313$ DEFINE SYS$ERROR _NLA0:
1314$ DEFINE SYS$OUTPUT _NLA0:
1315$ link deccvers.obj
1316$ tmp = $status
1317$ DEASSIGN SYS$ERROR
1318$ DEASSIGN SYS$OUTPUT
1319$ IF (silent) THEN GOSUB Shut_up
1320$ OPEN/WRITE CONFIG deccvers.out
1321$ DEFINE SYS$ERROR CONFIG
1322$ DEFINE SYS$OUTPUT CONFIG
1323$ mcr []deccvers.exe
1324$ tmp = $status
1325$ CLOSE CONFIG
1326$ DEASSIGN SYS$OUTPUT
1327$ DEASSIGN SYS$ERROR
1328$ IF (silent) THEN GOSUB Shut_up
1329$ OPEN/READ CONFIG deccvers.out
1330$ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1331$Dec_c_cleanup:
1332$ CLOSE CONFIG
1333$! DELETE/NOLOG/NOCONFIRM deccvers.*;
1334$ echo "You are using Dec C ''line'"
1335$ Dec_C_Version = line
1336$ ENDIF
1337$Vaxc_Invoke_check:
1338$ IF "''Using_Vax_C'".EQS."Yes"
1339$ THEN
1340$ echo ""
1341$ echo4 "Checking to see how to invoke Vax C..."
1342$ OPEN/WRITE CONFIG vaxcchk.c
1343$ WRITE CONFIG "#include <stdio.h>"
1344$ WRITE CONFIG "int main() {"
1345$ WRITE CONFIG " printf(""%i\n"", ""1"");"
1346$ WRITE CONFIG " exit(0);"
1347$ WRITE CONFIG "}"
1348$ CLOSE CONFIG
1349$ DEFINE SYS$ERROR _NLA0:
1350$ DEFINE SYS$OUTPUT _NLA0:
1351$ SET NOON
1352$ cc/vaxc/NoObj vaxcchk.c
1353$ tmp = $status
1354$ DEASSIGN SYS$OUTPUT
1355$ DEASSIGN SYS$ERROR
1356$ SET ON
1357$ IF (silent) THEN GOSUB Shut_up
1358$ IF tmp.NE.%X10B90001
1359$ THEN
1360$ Mcc = "cc"
1361$ ELSE
1362$ Mcc = "cc/vaxc"
1363$ ENDIF
1364$Vax_c_cleanup:
1365$ DELETE/NOLOG/NOCONFIRM vaxcchk.*;
1366$ ENDIF
1367$Gcc_check:
1368$ if "''using_gnu_c'" .eqs. "Yes"
1369$ THEN
1370$ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1371$ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1372$ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1373$ IF gcclib_olb .EQS. ""
1374$ THEN
1375$! These objects/libs come w/ gcc 2.7.2 for AXP:
1376$ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1377$ IF tmp .NES. "" then gcclib_olb = tmp
1378$ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1379$ IF tmp .NES. ""
1380$ THEN
1381$ IF gcclib_olb .EQS. ""
1382$ THEN gcclib_olb = tmp
1383$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1384$ ENDIF
1385$ ENDIF
1386$ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1387$ IF tmp .NES. ""
1388$ THEN
1389$ IF gcclib_olb .EQS. ""
1390$ THEN gcclib_olb = tmp
1391$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1392$ ENDIF
1393$ ENDIF
1394$ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1395$ IF tmp .NES. ""
1396$ THEN
1397$ IF gcclib_olb .EQS. ""
1398$ THEN gcclib_olb = tmp
1399$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1400$ ENDIF
1401$ ENDIF
1402$ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1403$ ELSE
1404$ gcclib_olb = gcclib_olb + "/lib"
1405$ ENDIF
1406$ IF gcclib_olb .NES. "" .AND. -
1407 (vaxcrtl_olb .NES. "" .OR. -
1408 vaxcrtl_exe .NES. "" )
1409$ THEN
1410$ echo ""
1411$ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1412$ OPEN/WRITE CONFIG gccvers.c
1413$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1414$ WRITE CONFIG "#include <stdio.h>"
1415$ WRITE CONFIG "int main() {"
1416$ WRITE CONFIG "#ifdef __GNUC__"
1417$ WRITE CONFIG "#ifdef __VERSION__"
1418$ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1419$ WRITE CONFIG "#else"
1420$ WRITE CONFIG " printf(""%s\n"", ""1"");"
1421$ WRITE CONFIG "#endif"
1422$ WRITE CONFIG "#endif"
1423$ WRITE CONFIG " exit(0);"
1424$ WRITE CONFIG "}"
1425$ CLOSE CONFIG
1426$ DEFINE SYS$ERROR _NLA0:
1427$ DEFINE SYS$OUTPUT _NLA0:
1428$ 'Mcc' gccvers.c
1429$ tmp = $status
1430$ DEASSIGN SYS$ERROR _NLA0:
1431$ DEASSIGN SYS$OUTPUT _NLA0:
1432$ IF (silent) THEN GOSUB Shut_up
1433$ DEFINE SYS$ERROR _NLA0:
1434$ DEFINE SYS$OUTPUT _NLA0:
1435$ IF vaxcrtl_exe .EQS. ""
1436$ THEN
1437$ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1438$ THEN
1439$ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1440$ tmp = $status
1441$ ELSE
1442$ link gccvers.obj,'gcclib_olb'
1443$ tmp = $status
1444$ ENDIF
1445$ ELSE
1446$ OPEN/WRITE CONFIG GCCVERS.OPT
1447$ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1448$ CLOSE CONFIG
1449$ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1450$ tmp = $status
1451$ ENDIF
1452$ DEASSIGN SYS$ERROR
1453$ DEASSIGN SYS$OUTPUT
1454$ IF (silent) THEN GOSUB Shut_up
1455$ OPEN/WRITE CONFIG gccvers.out
1456$ DEFINE SYS$ERROR CONFIG
1457$ DEFINE SYS$OUTPUT CONFIG
1458$ mcr []gccvers.exe
1459$ tmp = $status
1460$ CLOSE CONFIG
1461$ DEASSIGN SYS$OUTPUT
1462$ DEASSIGN SYS$ERROR
1463$ IF (silent) THEN GOSUB Shut_up
1464$ OPEN/READ CONFIG gccvers.out
1465$ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1466$Gcc_cleanup:
1467$ CLOSE CONFIG
1468$ DELETE/NOLOG/NOCONFIRM gccvers.*;
1469$ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1470$ THEN
1471$ echo "You are not using GNU cc."
1472$ GOTO Host_name
1473$ ELSE
1474$ echo "You are using GNU cc ''line'"
1475$ Using_Gnu_C = "Yes"
1476$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1477$ GOTO Include_dirs
1478$ ENDIF
1479$ ENDIF
1480$endif
1481$ GOTO Host_name
1482$!
1483$List_Parse:
1484$ OPEN/READ CONFIG ccvms.lis
1485$ READ CONFIG line
1486$ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1487$ THEN
1488$ read CONFIG line
1489$ archsufx = "VAX"
1490$ ELSE
1491$ archsufx = "AXP"
1492$ ENDIF
1493$ CLOSE CONFIG
1494$ line = F$EDIT(line,"TRIM,COMPRESS")
1495$ line = line - "Page 1" ! occurs at end all compilers
1496$ line = line - "CCVMS " ! filename appears w/ VAXC
1497$ line = line - "Source Listing " ! Seen w/ AXP DECC
1498$ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1499$ line = line - tmp
1500$ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1501$ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1502$ RETURN
1503$!
1504$Include_dirs:
1505$!: What should the include directory be ?
1506$ dflt = gcclib_olb
1507$ rp = "Where are the include files you want to use? "
1508$ IF f$length( rp + "[''dflt'] " ).gt.76
1509$ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1510$ ELSE rp = rp + "[''dflt'] "
1511$ ENDIF
1512$ GOSUB myread
1513$ usrinc = ans
1514$!
1515$!: see if we have to deal with yellow pages, now NIS.
1516$!: now get the host name
1517$Host_name:
1518$ echo ""
1519$ echo4 "Figuring out host name..." !>&4
1520$ myhostname = ""
1521$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1522$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1523$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1524$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1525$ IF myhostname.eqs."".and. -
1526 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1527 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
1528 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
1529$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1530$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1531$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1532$ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1533$!: you do not want to know about this
1534$!: verify guess
1535$ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1536$ GOSUB myread
1537$ IF (.not.ans).and.(ans.NES."")
1538$ THEN
1539$ READ SYS$COMMAND/PROMPT= -
1540 "Please type the (one word) name of your host: " ans
1541$ myhostname = ans
1542$ ENDIF
1543$!: translate upper to lower if necessary
1544$ myhostname = F$EDIT(myhostname,"COLLAPSE")
1545$ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1546$ IF mylowhostname.NES.myhostname
1547$ THEN
1548$ echo "(Normalizing case in your host name)"
1549$ myhostname = mylowhostname
1550$ ENDIF
1551$!
1552$ fp = F$LOCATE(".",myhostname)
1553$ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1554$ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
1555$ THEN
1556$ rp = "What is your domain name? [''mydomain'] "
1557$ GOSUB myread
1558$ IF ans THEN mydomain = ans
1559$!: translate upper to lower if necessary
1560$ mydomain = F$EDIT(mydomain,"COLLAPSE")
1561$ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1562$ IF mylowdomain.NES.mydomain
1563$ THEN
1564$ echo "(Normalizing case in your domain name)"
1565$ mydomain = mylowdomain
1566$ ENDIF
1567$ ENDIF
1568$ myhostname = myhostname - mydomain
1569$ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1570$ IF .NOT.silent
1571$ THEN TYPE SYS$INPUT:
1572
1573I need to get your e-mail address in Internet format if possible, i.e.
1574something like user@host.domain. Please answer accurately since I have
1575no easy means to double check it. The default value provided below
1576is most probably close to the reality but may not be valid from outside
1577your organization...
1578$ ENDIF
1579$ dflt = "''cf_by@''myhostname'"+"''mydomain'"
1580$ rp = "What is your e-mail address? [''dflt'] "
1581$ GOSUB myread
1582$ IF ans
1583$ THEN cf_email = ans
1584$ ELSE cf_email = dflt
1585$ ENDIF
1586$!
1587$ IF .NOT.silent
1588$ THEN TYPE SYS$INPUT:
1589
1590If you or somebody else will be maintaining perl at your site, please
1591fill in the correct e-mail address here so that they may be contacted
1592if necessary. Currently, the "perlbug" program included with perl
1593will send mail to this address in addition to perlbug@perl.com. You may
1594enter "none" for no administrator.
1595$ ENDIF
1596$ dflt = "''cf_email'"
1597$ rp = "Perl administrator e-mail address [''dflt'] "
1598$ GOSUB myread
1599$ IF ans
1600$ THEN perladmin = ans
1601$ ELSE perladmin = dflt
1602$ ENDIF
1603$!
1604$!: determine where public executable scripts go
1605$!: determine perl absolute location
1606$!: figure out how to guarantee perl startup
1607$!
1608$!: see how we invoke the C preprocessor
1609$! echo ""
1610$! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1611$!: Set private lib path
1612$!: Now check and see which directories actually exist, avoiding duplicates
1613$!: determine optimize, if desired, or use for debug flag also
1614$!: We will not override a previous value, but we might want to
1615$!: augment a hint file
1616$!: the following weeds options from ccflags that are of no interest to cpp
1617$!: flags used in final linking phase
1618$!: Try to guess additional flags to pick up local libraries.
1619$!: coherency check
1620$! echo ""
1621$! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1622$!: compute shared library extension
1623$!: Looking for optional libraries
1624$!: see if nm is to be used to determine whether a symbol is defined or not
1625$!: get list of predefined functions in a handy place
1626$!: see if we have sigaction
1627$!: see whether socketshr exists
1628$ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1629$ THEN
1630$ has_socketshr = "T"
1631$ echo ""
1632$ echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1633$ endif
1634$ if (Dec_C_Version .ge. 50200000)
1635$ THEN
1636$ Has_Dec_C_Sockets = "T"
1637$ echo ""
1638$ echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1639$ ENDIF
1640$ ! Hey, we've got both. Default to Dec C, then, since it's better
1641$ if ("''Has_socketshr'".eq."T") .or.("''has_dec_c_sockets'".eq."T")
1642$ THEN
1643$ echo ""
1644$ echo "You've got sockets available. Which socket stack do you want to"
1645$ echo "build into perl?"
1646$ if "''has_dec_c_sockets'".eqs."T"
1647$ THEN
1648$ dflt = "DECC"
1649$ else
1650$ dlft = "SOCKETSHR"
1651$ endif
1652$ rp = "Choose socket stack (NONE"
1653$ if "''has_socketshr'".eqs."T" THEN rp = rp + ",SOCKETSHR"
1654$ if "''has_dec_c_sockets'".eqs."T" THEN rp = rp + ",DECC"
1655$ rp = rp + ") [''dflt'] "
1656$ GOSUB myread
1657$ IF "''ans'".eqs."" THEN ans = "''dflt'"
1658$ has_dec_c_sockets = "F"
1659$ has_socketshr = "F"
1660$ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1661$ IF ans.eqs."decc" then has_dec_c_sockets = "T"
1662$ IF ans.eqs."socketshr" then has_socketshr = "T"
1663$ endif
1664$!
1665$!
1666$! Ask about threads, if appropriate
1667$ if (Using_Dec_C.eqs."Yes")
1668$ THEN
1669$ echo "This version of Perl can be built with threads. While really nifty,
1670$ echo "they are a beta feature, and there is a speed penalty for perl
1671$ echo "programs if you build with threads *even if you don't use them*
1672$ echo ""
1673$ dflt = "y"
1674$ rp = "Build with threads? [''dflt'] "
1675$ GOSUB myread
1676$ if ans.eqs."" then ans = dflt
1677$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
1678$ THEN
1679$ use_threads="T"
1680$ ENDIF
1681$ ENDIF
1682$!
1683$! Ask if they want to use perl's memory allocator
1684$ echo ""
1685$ echo "Perl has a built-in memory allocator that's tuned for perl's
1686$ echo "normal memory usage. It's oftentimes better than the standard
1687$ echo "system memory allocator. It also has the advantage of providing
1688$ echo "memory allocation statistics.
1689$ echo ""
1690$ dflt = "N"
1691$ rp = "Build with perl's memory allocator? [''dflt'] "
1692$ GOSUB myread
1693$ if ans.eqs."" then ans="''dflt'"
1694$ mymalloc = f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE"))
1695$!
1696$! Ask for their default list of extensions to build
1697$ echo ""
1698$ echo "It's time to specify which modules you want to build into
1699$ echo "perl. Most of these are standard and should be chosen, though
1700$ echo "you might, for example, want to build GDBM_File instead of
1701$ echo "SDBM_File if you have the GDBM library built on your machine
1702$ echo "
1703$ echo "Which modules do you want to build into perl?"
1704$ dflt = "Fcntl IO Opcode attrs Stdio DCLsym B SDBM_File"
1705$ if Using_Dec_C.eqs."Yes"
1706$ THEN
1707$ dflt = dflt + " POSIX"
1708$ if Use_Threads.eqs."T"
1709$ THEN
1710$ dflt = dflt + " Thread"
1711$ ENDIF
1712$ ENDIF
1713$ rp = "[''dflt'] "
1714$ GOSUB myread
1715$ if ans.eqs."" then ans = "''dflt'"
1716$ extensions = "''ans'"
1717$!
1718$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
1719$ echo ""
1720$ echo "%Config-I-VMS, Checking your ""make"" utilities..."
1721$! If the 'build' that you use is not here add it and it's test
1722$! switch to the _END_ of these strings (and increment max_build)
1723$! (e.g. builders = builders + "/FOOMAKE"
1724$! probers = probers + " -fooVersionSwitch"
1725$! ) & please let me know about it.
1726$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
1727$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
1728$ max_build = 7
1729$!
1730$ orig_dflt = "MMK"
1731$ default_set = ""
1732$ ok_builders = ""
1733$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
1734$ WRITE CONFIG "dont_make_anything_yet:"
1735$ WRITE CONFIG F$FAO("!_")
1736$ CLOSE CONFIG
1737$ n = 0
1738$ messages = F$ENVIRONMENT("MESSAGE")
1739$Build_probe:
1740$ build = F$ELEMENT(n,"/",builders)
1741$ probe = F$ELEMENT(n,"!",probers)
1742$ echo "Testing whether you have ''build' on your system..."
1743$ SET NOON !sorry :-(
1744$ ON CONTROL_Y THEN GOTO Reenable_messages_build !sorry :-(
1745$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT !sorry :-(
1746$ 'build' 'probe'
1747$ IF ($SEVERITY .EQ. 1)
1748$ THEN
1749$ echo "OK."
1750$ IF (build .EQS. orig_dflt)
1751$ THEN
1752$ default_set = "TRUE"
1753$ dflt = build
1754$ ENDIF
1755$ ok_builders = ok_builders + " " + build
1756$ IF (.NOT. default_set) THEN dflt = build
1757$ ELSE
1758$ echo "Nope."
1759$ ENDIF
1760$Reenable_messages_build: !hope you made it here :-)
1761$ SET MESSAGE 'messages' !hope you made it here :-)
1762$ SET ON !hope you made it here :-)
1763$ n = n + 1
1764$ IF (n .LT. max_build) THEN GOTO Build_probe
1765$!
1766$ echo ""
1767$ IF (ok_builders .NES. "")
1768$ THEN
1769$ echo "Here is the list of builders you can apparently use:"
1770$ echo "(",ok_builders," )"
1771$ rp = "Which """"make"""" utility do you wish to use [''dflt']? "
1772$ GOSUB myread
1773$ ans = F$EDIT(ans,"TRIM, COMPRESS")
1774$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1775$ IF (ans .EQS. "")
1776$ THEN build = dflt
1777$ ELSE build = ans
1778$ ENDIF
1779$ ELSE
1780$ TYPE SYS$INPUT:
1781
1782%Config-E-VMS, ERROR:
1783 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
1784 utility of some sort and after checking my "builders" list I cannot find
1785 the symbol or command you use on your system to compile programs.
1786
1787$ READ SYS$COMMAND/PROMPT="%Config-I-VMS, Which ""MMS"" do you use? " ans
1788$ ans = F$EDIT(ans,"TRIM, COMPRESS")
1789$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
1790$ IF (ans .EQS. "")
1791$ THEN build = dflt
1792$ echo "I don't know where 'make' is, and my life depends on it."
1793$ echo "Go find a make program or fix your DCL$PATH setting!"
1794$ echo "ABORTING..."
1795$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1796$ STOP
1797$ EXIT 2 !$STATUS = "%X00000002" (error)
1798$ ELSE
1799$ build = ans
1800$ ENDIF
1801$ ENDIF
1802$!
1803$ DELETE/NOLOG Makefile.;
1804$ GOTO Beyond_open
1805$Open_error:
1806$ TYPE SYS$INPUT:
1807
1808 There seems to be trouble. I just tried to create a file in
1809$ echo4 'F$ENVIRONMENT("DEFAULT")'
1810$ TYPE SYS$INPUT:
1811 but was unsuccessful. I am stopping now. Please check that directories'
1812 PROTECTION bits. I will leave you in the directory where you started
1813 Configure.com
1814$ echo4 "ABORTING..."
1815$ GOTO Clean_up
1816$ STOP
1817$ EXIT
1818$!
1819$Beyond_open:
1820$! echo " Very well I will proceed with ""''build'"""
1821$ make = F$EDIT(build,"UPCASE")
1822$!
1823$!: locate the preferred pager for this system
1824$!pagers = "most|more|less|type/page"
1825$!rp='What pager is used on your system?'
1826$!
1827$! update [.vms]config.vms here
1828$!
1829$! update makefile here
1830$! echo4 "Updating makefile..."
1831$!
1832$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
1833$ THEN
1834$ makefile = "" !wrt MANIFEST dir
1835$ UUmakefile = "DESCRIP.MMS" !wrt CWD dir
1836$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
1837$ ELSE
1838$ makefile = " -f [.VMS]Makefile." !wrt MANIFEST dir
1839$ UUmakefile = "[-.VMS]Makefile." !wrt CWD dir
1840$ DEFmakefile = "[-.VMS]Makefile." !wrt DEF dir (?)
1841$ ENDIF
1842$!
1843$ IF macros.NES.""
1844$ THEN
1845$ tmp = F$LENGTH(macros)
1846$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
1847$ macros = "/macro=(" + macros + ")"
1848$ ENDIF
1849$!
1850$! Invoke the subconfig piece
1851$!
1852$ echo ""
1853$ echo4 "Generating config.h"
1854$ dflt = F$ENVIRONMENT("DEFAULT")
1855$ SET DEFAULT [-.vms]
1856$ @subconfigure
1857$ SET DEFAULT 'dflt
1858$!
1859$! %Config-I-VMS, write perl_setup.com here
1860$!
1861$ echo ""
1862$ echo4 "%Config-I-VMS, The perl_setup.com file is now being written..."
1863$ file_2_find = "[-.vms]perl_setup.com"
1864$ OPEN/WRITE CONFIG 'file_2_find'
1865$ WRITE CONFIG "$!"
1866$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
1867$ IF cf_email.NES.perladmin
1868$ THEN
1869$ WRITE CONFIG "$! perl configured by ''cf_email'"
1870$ ELSE
1871$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
1872$ ENDIF
1873$ WRITE CONFIG "$!"
1874$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
1875 prefix = prefix - "]" + ".]"
1876$ WRITE CONFIG "$ define/translation=concealed Perl_Root ''prefix'"
1877$ WRITE CONFIG "$ perl :== $Perl_Root:[000000]Perl"
1878$ WRITE CONFIG "$ define PerlShr Perl_Root:[000000]PerlShr.Exe"
1879$ IF (tzneedset)
1880$ THEN
1881$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
1882$ ELSE !leave in but commented out (in case setting was from perl :-)
1883$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
1884$ ENDIF
1885$ WRITE CONFIG "$!"
1886$ WRITE CONFIG "$! Symbols for commonly used scripts:"
1887$ WRITE CONFIG "$!"
1888$ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' Perl_Root:[lib.pod]Perldoc.com -t"""
1889$ CLOSE CONFIG
1890$!
1891$ echo ""
1892$ echo "%Config-I-VMS, The file can be found at:"
1893$ echo4 "-Config-I-VMS, ''F$SEARCH(file_2_find)'"
1894$ echo "-Config-I-VMS, Add that file (or an @ call to it) to your [SY]LOGIN.COM"
1895$ echo "-Config-I-VMS, when you are satisfied with a successful compilation,"
1896$ echo "-Config-I-VMS, testing, and installation of your perl."
1897$ echo ""
1898$!
1899$!figure out where we "are" by parsing 'vms_default_directory_name'
1900$!
1901$ set_def_command = ""
1902$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
1903$ tmp = vms_default_directory_name - dflt - "]"
1904$ i = 0
1905$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
1906$Set_def_loop:
1907$ tmp1 = F$ELEMENT(i,".",tmp)
1908$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
1909$ IF i .EQ. 0
1910$ THEN set_def_command = "set default [-"
1911$ ELSE set_def_command = set_def_command + "-"
1912$ ENDIF
1913$ i = i + 1
1914$ GOTO Set_def_loop
1915$Beyond_set_def_loop:
1916$ IF set_def_command.NES.""
1917$ THEN
1918$ set_def_command = set_def_command - "-" + "]"
1919$ echo4 ""
1920$ echo4 "In order to build ''package' you must now issue the commands:"
1921$ echo4 ""
1922$ echo4 " ''set_def_command'"
1923$ ELSE
1924$ echo4 ""
1925$ echo4 "In order to build ''package' you must now issue the command:"
1926$ echo4 ""
1927$ ENDIF
1928$ echo4 " ''make'''makefile'", macros
1929$ echo4 ""
1930$!
1931$Clean_up:
1932$ IF (silent)
1933$ THEN
1934$ DEASSIGN SYS$OUTPUT
1935$! DEASSIGN SYS$ERROR
1936$ ENDIF
1937$ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
1938$ IF F$GETJPI("","FILCNT").NE.vms_filcnt
1939$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
1940$ ENDIF
1941$ dflt = F$ENVIRONMENT("DEFAULT")
1942$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
1943$ THEN
1944$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
1945$ SET DEFAULT [-]
1946$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
1947$ DELETE/NOLOG/NOCONFIRM UU.DIR;
1948$ ENDIF
1949$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1950$ STOP
1951$ EXIT
1952$!: End of Configure