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