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