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