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