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