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