This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
(??{ }) anomaly
[perl5.git] / configure.com
1 $! OpenVMS configuration procedure for Perl -- do not attempt to run under DOS
2 $ sav_ver = 'F$VERIFY(0)'
3 $ on control_y then goto clean_up
4 $! SET VERIFY
5 $!
6 $! For example, if you unpacked perl into: [USER.PERL-5n...] then you will 
7 $! want to cd into the tree and execute Configure:
8 $!
9 $! $ SET DEFAULT [USER.PERL5_xxx]
10 $! $ @Configure 
11 $!
12 $! or
13 $!
14 $! $ SET DEFAULT [USER.PERL5_xxx]
15 $! $ @Configure "-des"
16 $!
17 $! That's it. If you get into a bind trying to build perl on VMS then 
18 $! definitely read through the README.VMS file.
19 $! Beyond that send email to vmsperl@perl.org
20 $!
21 $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22 $!
23 $! send suggestions to: 
24 $!  Dan Sugalski <dan@sidhe.org>
25 $! Thank you!!!!
26 $!
27 $! Adapted and converted from Larry Wall & Andy Dougherty's
28 $! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
29 $! (a Bourne sh[ell] script for configuring the installation of perl 
30 $! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
31 $! with much valuable help from Charles Bailey & 
32 $! the whole VMSPerl crew.
33 $! Extended and messed about with by Dan Sugalski
34 $!
35 $! VMS-isms we will need:
36 $ echo = "write sys$output "
37 $ cat  = "type"
38 $ delete := delete ! local symbol overrides globals with qualifiers
39 $ gcc_symbol = "gcc"
40 $ ld = "Link"
41 $ ans = ""
42 $ macros = ""
43 $ extra_flags = ""
44 $ user_c_flags = ""
45 $ use_ieee_math = "y"
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 $ ccflags = ""
56 $ static_ext = ""
57 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
58 $ max_allowed_dir_depth = 3  ! e.g. [A.B.PERLxxx] not [A.B.C.PERLxxx]
59 $! max_allowed_dir_depth = 2 ! e.g. [A.PERLxxx] not [A.B.PERLxxx]
60 $!
61 $! Sebastian Bazley's request: close the CONFIG handle with /NOLOG
62 $! qualifier "just in case" (configure.com is re @ed in a bad state).
63 $! This construct was tested to be not a problem as far back as
64 $! VMS V5.5-2, hopefully earlier versions are OK as well.
65 $!
66 $ CLOSE/NOLOG CONFIG
67 $!
68 $! Now keep track of open files
69 $!
70 $ vms_filcnt = F$GETJPI ("","FILCNT")
71 $!
72 $!: compute my invocation name
73 $ me = F$ENVIRONMENT("PROCEDURE")
74 $!
75 $! Many null statements (begin with colon ':') in the Bourne shell version of
76 $! this script serve as comments/placeholders. I have retained some of the ones
77 $! that will help you compare this .COM file to the sh version - as well as
78 $! leave placeholders for future improvements to this .COM file.
79 $! sfn = VMS "skipped for now"
80 $!
81 $!: Proper PATH separator                              !sfn
82 $!: Proper PATH setting                                !sfn
83 $!: Sanity checks                                      !sfn "Say '@''$me''"
84 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
85 $!: Configure runs within the UU subdirectory          !->after find MANIFEST
86 $!   <big long list of default values (mostly null)>
87 $!: We must find out about Eunice early                !(?)
88 $!: list of known cpp symbols, sorted alphabetically   !sfn
89 $!   al = al + "..."
90 $!: default library list                               !sfn
91 $!   <no hints files in use (yet?)>
92 $!: Extra object files, if any, needed on this platform. !sfn
93 $!: Possible local include directories to search.      !sfn
94 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
95 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
96 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
97 $!: no include file wanted by default                  !sfn
98 $!inclwanted=''                                        !sfn
99 $!: Possible local library directories to search.      !sfn
100 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
101 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
102 $!: general looking path for locating libraries        !sfn
103 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
104 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
105 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
106 $!: Private path used by Configure to find libraries.  Its value !sfn
107 $!: is prepended to libpth. This variable takes care of special !sfn
108 $!: machines, like the mips.  Usually, it should be empty. !sfn
109 $!plibpth=''                                           !sfn
110 $!: full support for void wanted by default            !sfn
111 $!defvoidused=15                                       !sfn
112 $!: List of libraries we want.                         !sfn
113 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
114 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
115 $!libswanted="$libswanted ucb bsd BSD PW x"            !sfn
116 $!: We probably want to search /usr/shlib before most other libraries. !sfn
117 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
118 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
119 $!glibpth="/usr/shlib $glibpth"                        !sfn
120 $!: Do not use vfork unless overridden by a hint file. !sfn
121 $!usevfork=false                                       !sfn
122 $!: script used to extract .SH files with variable substitutions !sfn
123 $!: produce awk script to parse command line options   !sfn
124 $!sfn (assume no sed awk) see below
125 $!: process the command line options         
126 $!
127 $!: set up default values
128 $ fastread=""
129 $ reuseval="false"
130 $ maniskip = "false"
131 $ IF F$TYPE(config_sh) .EQS. "" THEN config_sh=""
132 $ alldone=""
133 $ error=""
134 $ silent=""
135 $ extractsh=""
136 $ override=""
137 $ knowitall=""
138 $ ccname="VAX"
139 $ Dec_C_Version = ""
140 $ cxxversion = ""
141 $ use_threads = "F"
142 $ use_5005_threads = "N"
143 $ use_ithreads = "N"
144 $!
145 $!: option parsing
146 $ config_args = ""
147 $ IF (P1 .NES. "")
148 $ THEN            !one or more switches was thrown
149 $   i = 1
150 $   bang = 0
151 $Param_loop:
152 $   IF (P'i'.NES."") 
153 $   THEN
154 $     bang = bang + 1
155 $     config_args = config_args + F$FAO(" !AS",P'i')
156 $   ENDIF
157 $   i = i + 1
158 $   IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
159 $!
160 $   i = 1
161 $Opt_loop:
162 $   IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
163 $   IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
164 $Remove_quotation_mark:
165 $   P'i' = P'i' - """"
166 $   IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
167 $   gotopt      = "f" !"alse"
168 $   gotshortopt = "f" !"alse"
169 $   IF (F$EXTRACT(0,1,P'i') .EQS. "d")
170 $   THEN
171 $     fastread    = "yes"
172 $     gotopt      = "t" !"rue"
173 $     P'i'        = P'i' - "d"
174 $     gotshortopt = "t" !"rue"
175 $   ENDIF
176 $   IF (F$EXTRACT(0,1,P'i') .EQS. "e")
177 $   THEN
178 $     alldone = "cont"
179 $     gotopt = "t"
180 $     P'i' = P'i' - "e"
181 $     gotshortopt = "t"
182 $   ENDIF
183 $   IF (F$EXTRACT(0,1,P'i') .EQS. "f") ! "-f"
184 $   THEN
185 $     P'i' = P'i' - "f"
186 $     config_sh = P'i'
187 $     IF (F$SEARCH(config_sh).NES."")
188 $     THEN
189 $       test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
190 $       IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh)) 
191 $       THEN
192 $         config_dflt = "y"
193 $         CONTINUE !at this point check UIC && if test allows...
194 $                  !to be continued ?
195 $       ELSE
196 $         echo "''me': cannot read config file ''config_sh'."
197 $         error="true"
198 $       ENDIF
199 $     ELSE
200 $       echo "''me': cannot read config file ''config_sh'."
201 $       error="true"
202 $     ENDIF
203 $     gotopt = "t"
204 $   ENDIF
205 $   IF (F$EXTRACT(0,1,P'i') .EQS. "h") ! "-h"
206 $   THEN
207 $     error = "true"
208 $     gotopt = "t"
209 $     P'i' = P'i' - "h"
210 $     gotshortopt = "t"
211 $   ENDIF
212 $   IF (F$EXTRACT(0,1,P'i') .EQS. "m")  ! "-m"
213 $   THEN
214 $     maniskip = "true"
215 $     gotopt = "t"
216 $     P'i' = P'i' - "m"
217 $     gotshortopt = "t"
218 $   ENDIF
219 $   IF (F$EXTRACT(0,1,P'i') .EQS. "r")  ! "-r"
220 $   THEN
221 $     reuseval = "true"
222 $     gotopt = "t"
223 $     P'i' = P'i' - "r"
224 $     gotshortopt = "t"
225 $   ENDIF
226 $   IF (F$EXTRACT(0,1,P'i') .EQS. "s") ! "-s"
227 $   THEN
228 $     silent = "true"
229 $     gotopt = "t"
230 $     P'i' = P'i' - "s"
231 $     gotshortopt = "t"
232 $   ENDIF
233 $   IF (F$EXTRACT(0,1,P'i') .EQS. "E") ! "-E"
234 $   THEN
235 $     alldone = "exit"
236 $     gotopt = "t"
237 $   ENDIF
238 $   IF (F$EXTRACT(0,1,P'i') .EQS. "K") ! "-K"
239 $   THEN
240 $     knowitall = "true"
241 $     gotopt = "t"
242 $     P'i' = P'i' - "K"
243 $     gotshortopt = "t"
244 $   ENDIF
245 $   IF (F$EXTRACT(0,1,P'i') .EQS. "O") ! "-O"
246 $   THEN
247 $     override = "true"
248 $     gotopt = "t"
249 $     P'i' = P'i' - "O"
250 $     gotshortopt = "t"
251 $   ENDIF
252 $   IF (F$EXTRACT(0,1,P'i') .EQS. "S") ! "-S"
253 $   THEN
254 $     extractsh = "true"  !VMS?  Yes with munchconfig
255 $     gotopt = "t"
256 $     P'i' = P'i' - "S"
257 $     gotshortopt = "t"
258 $   ENDIF
259 $   IF (F$EXTRACT(0,1,P'i') .EQS. "D") ! "-D"
260 $   THEN
261 $     P'i' = P'i' - "D"
262 $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
263 $     THEN
264 $       tmp = P'i' + "=""define"""
265 $       'tmp'
266 $       DELETE/SYMBOL tmp
267 $     ELSE 
268 $       IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
269 $       THEN
270 $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
271 $         echo "''me': use ""-Usymbol=val"" not ""-Dsymbol=""."
272 $         echo "''me': ignoring -D",P'i'
273 $       ELSE
274 $          tmp = F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')
275 $          tmp = tmp + "=""" + F$EXTRACT(F$LOCATE("=",P'i')+1,F$LENGTH(P'i'),P'i') + """"
276 $         'tmp'
277 $         DELETE/SYMBOL tmp
278 $       ENDIF
279 $     ENDIF
280 $     gotopt = "t"
281 $   ENDIF
282 $   IF (F$EXTRACT(0,1,P'i') .EQS. "U") ! "-U"
283 $   THEN
284 $     P'i' = P'i' - "U"
285 $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
286 $     THEN
287 $       tmp = P'i' + "="""""
288 $       'tmp'
289 $       DELETE/SYMBOL tmp
290 $     ELSE 
291 $       IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
292 $       THEN
293 $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
294 $         echo "''me': use ""-Dsymbol=val"" not ""-Usymbol=val""."
295 $         echo "''me': ignoring -U",P'i'
296 $       ELSE
297 $         tmp = P'i' + "=""undef"""
298 $         'tmp'
299 $         DELETE/SYMBOL tmp
300 $       ENDIF
301 $     ENDIF
302 $     gotopt = "t"
303 $   ENDIF
304 $   IF (F$EXTRACT(0,1,P'i') .EQS. "V")
305 $   THEN
306 $     me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
307 $     echo "''me' generated by an unknown version of EDT."
308 $     STOP
309 $     EXIT
310 $   ENDIF
311 $   IF .NOT.gotopt 
312 $   THEN
313 $     echo "''me': unknown option ",P'i'
314 $     error = "true"
315 $   ENDIF
316 $   IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
317 $   i = i + 1 
318 $   IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
319 $!
320 $ ENDIF  ! (P1 .NES. "")
321 $ config_args = F$EDIT(config_args,"TRIM")
322 $!
323 $ IF (error)
324 $ THEN
325 $   me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
326 $   echo "Usage: @''me' [-dehmr""EKOSV""] [-fconfig.sh] [""-Dsymbol""] [""-Dsymbol=value""]"
327 $   echo "                [-Usymbol]  [-Usymbol=]"
328 $   TYPE SYS$INPUT:
329 $   DECK
330  "-d" : use defaults for all answers.
331  "-e" : go on without questioning past the production of config.sh.    *
332  "-f" : specify an alternate default configuration file.
333  "-h" : print this help message and exit (with an error status).
334  "-m" : skip the MANIFEST check to see that all files are present
335  "-r" : reuse C symbols value if possible (skips costly nm extraction).*
336  "-s" : silent mode, only echoes questions and essential information.
337  -"D" : define symbol to have some value:                              *
338          -"Dsymbol"         symbol gets the value 'define'
339          -"Dsymbol=value"   symbol gets the value 'value'
340   -E  : stop at the end of questions, after having produced config.sh. *
341   -K  : do not use unless you know what you are doing.
342   -O  : let -D and -U override definitions from loaded configuration file. *
343   -S  : perform variable substitutions on all .SH files (can mix with -f) *
344  -"U" : undefine symbol:                                               *
345          -"Usymbol"    symbol gets the value 'undef'
346          -"Usymbol="   symbol gets completely empty
347   -V  : print version number and exit (with a zero status).
348 $   EOD
349 $   echo "%Config-I-VMS, lower case switches must be enclosed"
350 $   echo "-Config-I-VMS, in double quotation marks, e.g.:"
351 $   echo "-Config-I-VMS,   @Configure ""-des"""
352 $   echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
353 $   SET DEFAULT 'vms_default_directory_name' !be kind rewind
354 $   STOP
355 $   EXIT 3 ! $STATUS = "%X00000003" (informational)
356 $ ENDIF
357 $!
358 $ GOTO Check_silence
359 $!
360 $Shut_up:
361 $ IF F$Mode() .eqs. "BATCH"
362 $ THEN
363 $   STDOUT = F$PARSE(F$GETQUI("DISPLAY_ENTRY", "JOB_NAME"), -
364                     F$GETQUI("DISPLAY_ENTRY", "LOG_SPECIFICATION"), ".LOG")
365 $   WRITE SYS$OUTPUT "Warning: Executing in batch mode.  To avoid file locking conflicts,"
366 $   WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
367 $   WRITE SYS$OUTPUT STDOUT
368 $ ELSE
369 $   STDOUT = F$TRNLNM("SYS$OUTPUT")
370 $ ENDIF
371 $ DEFINE SYS$OUTPUT "_NLA0:"
372 $ echo4 = "write STDOUT "
373 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
374 $ open/write/share=read STDOUT 'STDOUT'
375 $ RETURN
376 $!
377 $Check_silence:
378 $ IF (silent) 
379 $ THEN
380 $   GOSUB Shut_up
381 $ ELSE
382 $   echo4 = "write SYS$OUTPUT "
383 $   cat4 = "TYPE"
384 $ ENDIF
385 $!
386 $!: run the defines and the undefines, if any, but leave the file out there...
387 $! Unfortunately Configure.COM in DCL is not yet set up to do this - 
388 $! maybe someday
389 $!
390 $!: set package name
391 $ package = "perl5"
392 $ packageup = F$EDIT((package - "5"),"UPCASE")
393 $!
394 $!: Eunice requires " " instead of "", can you believe it
395 $ echo ""
396 $!: Here we go...
397 $ echo "Beginning of configuration questions for ''package'."
398 $ echo ""
399 $!
400 $!: Some greps do not return status, grrr.
401 $ contains = "SEARCH"
402 $!
403 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
404 $! echo "Checking ''echo' to see how to suppress newlines..."
405 $! echo "giving up..."
406 $! echo "The star should be here-->*"
407 $!
408 $!: Now test for existence of everything in MANIFEST
409 $ echo ""
410 $ echo4 "First let's make sure your kit is complete.  Checking..."
411 $ manifestfound = "" 
412 $ miss_list = "" 
413 $! Here I assume we are in the [foo.PERLxxx...] tree
414 $! because the search routine simply does set def [-] if necessary.
415 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...] 
416 $Research_manifest:
417 $ manifestfound = F$SEARCH(file_2_find)
418 $ IF (manifestfound .EQS. "")
419 $ THEN
420 $   IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
421 $   THEN
422 $     SET DEFAULT [-]
423 $     GOTO Research_manifest
424 $   ELSE
425 $     echo ""
426 $     echo "There is no MANIFEST file.  I hope your kit is complete !"
427 $     miss_list = ""
428 $     GOTO Beyond_manifest
429 $   ENDIF
430 $ ELSE
431 $! MANIFEST. has been found and we have set def'ed there.
432 $! Time to bail out before it's too late, i.e. too deep.
433 $! Depth check is unnecessary on Alpha VMS V7.2++ (even for ODS-2).
434 $   tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
435 $   IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
436 $! Depth check also unnecessary on ODS 5 (or later) file systems.
437 $   tmp = F$INTEGER(F$GETDVI(F$ENVIRONMENT("DEFAULT"),"ACPTYPE") - "F11V")
438 $   IF (tmp .GE. 5) THEN GOTO Beyond_depth_check
439 $   IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("DEFAULT")).nes.".")
440 $   THEN
441 $     TYPE SYS$INPUT:
442 $     DECK
443 %Config-E-VMS, ERROR:
444  Sorry! It apears as though your perl build sub-directory is already too
445  deep into the VMS file system. Please try moving stuff into a shallower 
446  directory (or altering the "max_allowed_dir_depth" parameter).
447 $     EOD
448 $     echo4 "ABORTING..."
449 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
450 $     STOP
451 $     EXIT !2 !$STATUS = "%X00000002" (error)
452 $   ENDIF
453 $Beyond_depth_check:
454 $!
455 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
456 $!
457 $   IF (manifestfound .NES. "")
458 $   THEN
459 $     IF ( F$SEARCH("UU.DIR").EQS."" )
460 $     THEN
461 $       CREATE/DIRECTORY [.UU]
462 $     ELSE
463 $       IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
464 $     ENDIF
465 $!: Configure runs within the UU subdirectory
466 $     SET DEFAULT [.UU]
467 $!
468 $! a little redundancy never hurt anybody?
469 $     file_2_find = "[-]" + file_2_find
470 $     manifestfound = F$SEARCH(file_2_find)
471 $!
472 $     OPEN/WRITE MISSING MISSING.
473 $!change to "FALSE" if you wish to skip the manifest search 
474 $!(which after all is rather slow in DCL :-)
475 $     IF (maniskip)
476 $     THEN
477 $       echo "Skipping MANIFEST check as requested"
478 $     ELSE
479 $!
480 $       OPEN/READ CONFIG 'manifestfound'
481 $Read_loop_manifest:
482 $       READ/END_OF_FILE = Done_manifest CONFIG line
483 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
484 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
485 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
486 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
487 $       line = F$EDIT(line,"TRIM, COMPRESS")
488 $       file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line) 
489 $       IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find) 
490 $       THEN 
491 $Re_strip_line_manifest:
492 $         loca = F$LOCATE("/",file_2_find)
493 $         ante = F$EXTRACT(0,loca,file_2_find)
494 $         post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
495 $         test_this = ante + "." + (post - "/")
496 $         IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
497 $         THEN 
498 $           file_2_find = ante + "." + (post - "/")
499 $           GOTO Re_strip_line_manifest
500 $         ELSE
501 $           file_2_find = ante + "]" + (post - "/")
502 $         ENDIF
503 $           file_2_find = "[-."+file_2_find
504 $       ELSE
505 $         file_2_find = "[-]" + file_2_find
506 $       ENDIF
507 $!
508 $       dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
509 $       file_2_find = file_2_find - dirname
510 $!
511 $!      may not need double dot check on ODS-5 volumes
512 $       found = F$SEARCH(dirname + file_2_find)
513 $       IF found .NES. "" THEN GOTO Read_loop_manifest
514 $!
515 $       dots = 0
516 $Dot_loop:
517 $       dot_ele = F$ELEMENT(dots,".",file_2_find)
518 $       IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
519 $       IF dots .eq. 0
520 $       THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
521 $       ELSE basename = basename + dot_ele + "_"
522 $       ENDIF
523 $       dots = dots + 1
524 $       GOTO dot_loop
525 $Eo_dot_loop:
526 $       IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
527              (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
528           basename = f$extract(0,f$length(basename)-1,basename)
529 $       file_2_find = dirname + basename
530 $!
531 $       found = F$SEARCH(file_2_find)
532 $       IF (found .EQS. "" .AND. dots .GT. 2)
533 $       THEN
534 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
535 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
536 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
537 $         basename[f$locate(".",basename),1] := _
538 $         dot_ele = F$ELEMENT(dots - 1,"_",basename)
539 $         basename = -
540             f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
541               + "." + dot_ele
542 $         found = F$SEARCH(dirname + basename)
543 $         file_2_find = file_2_find + "," + basename
544 $       ENDIF
545 $       IF (found .EQS. "")
546 $       THEN
547 $         WRITE MISSING file_2_find
548 $         IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
549 $         THEN
550 $           miss_list = miss_list + "," + file_2_find
551 $         ENDIF
552 $       ENDIF
553 $       GOTO Read_loop_manifest
554 $Done_manifest:
555 $       CLOSE CONFIG
556 $     ENDIF  !"TRUE"
557 $     CLOSE MISSING
558 $   ENDIF ! (manifestfound .NES. "")
559 $Beyond_manifest:
560 $   IF (miss_list .NES. "")
561 $   THEN
562 $     echo "Some of the files not found include:"
563 $     cat4 MISSING.
564 $   ENDIF
565 $   IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
566 $   THEN
567 $     TYPE SYS$INPUT:
568 $     DECK
569
570
571 THIS PACKAGE SEEMS TO BE INCOMPLETE.
572
573 You have the option of continuing the configuration process, despite the
574 distinct possibility that your kit is damaged, by typing 'y'es.  If you
575 do, don't blame me if something goes wrong.  I advise you to type 'n'o
576 and contact the author (dan@sidhe.org)
577
578 $     EOD
579 $     READ SYS$COMMAND/PROMPT="Continue? [n] " ans
580 $     IF ans
581 $     THEN
582 $       echo4 "Continuing..."
583 $     ELSE
584 $       echo4 "ABORTING..."
585 $       GOTO Clean_up
586 $     ENDIF
587 $   ELSE
588 $     echo4 "Looks good..."
589 $     DELETE/NOLOG MISSING.;
590 $   ENDIF ! (miss_list .NES. "")
591 $ ENDIF   ! (manifestfound .EQS. "") ELSE 
592 $!
593 $! after finding MANIFEST (see above)
594 $!: Configure runs within the UU subdirectory 
595 $!
596 $!: compute the number of columns on the terminal for proper question formatting
597 $ IF F$MODE() .EQS. "BATCH"
598 $! else it winds up being 512 in batch
599 $ THEN COLUMNS = 80
600 $ ELSE COLUMNS = F$GETDVI("SYS$OUTPUT","DEVBUFSIZ")
601 $ ENDIF
602 $! "-des" sets SYS$OUTPUT to NL: with a DEVBUFSIZ too large (512 again)
603 $ IF COLUMNS .GT. 210 THEN COLUMNS = 80
604 $! not sure if this would actually be needed - it hopefully will not hurt
605 $ IF COLUMNS .LT. 40 THEN COLUMNS = 40
606 $!
607 $!: set up the echo used in my read              !sfn
608 $!: now set up to do reads with possible shell escape and default assignment !sfn
609 $ GOTO Beyond_myread
610 $!
611 $! The sub_rp splitting is intended to handle long symbols such as the dflt for
612 $! extensions.
613 $!
614 $myread:
615 $ ans = ""
616 $ len_rp = F$LENGTH(rp)
617 $   If (.NOT. silent) Then echo ""
618 $   IF len_rp .GT. 210
619 $   THEN
620 $     i_rp = 0
621 $   rp_loop:
622 $       sub_rp = F$EXTRACT(i_rp,COLUMNS,rp)
623 $       i_rp = i_rp + COLUMNS
624 $       if i_rp .LT. len_rp THEN echo4 "''sub_rp'"
625 $     IF i_rp .LT. len_rp THEN GOTO rp_loop
626 $   ELSE
627 $   sub_rp = rp
628 $   ENDIF
629 $ if (fastread)
630 $ then
631 $     echo4 "''sub_rp'"
632 $ else
633 $     READ SYS$COMMAND/PROMPT="''sub_rp'" ans
634 $ endif
635 $   IF (ans .EQS. "&-d")
636 $   THEN
637 $     echo4 "(OK, I will run with -d after this question.)"
638 $   echo ""
639 $   deferred_fastread =1
640 $   goto myread
641 $   ENDIF
642 $   IF (ans .EQS. "&-s")
643 $   THEN
644 $     echo4 "(OK, I will run with -s after this question.)"
645 $     echo ""
646 $   deferred_silent = 1
647 $   goto myread
648 $     ENDIF
649 $ if (bool_dflt .nes. "")
650 $ then
651 $   if (ans .eqs. "") then ans = bool_dflt
652 $   ans = f$extract(0,1,f$edit(ans,"collapse,upcase"))
653 $   if (ans .eqs. "Y" .or. ans .eqs. "1" .or. ans .eqs. "T") 
654 $   then
655 $       ans = "Y"
656 $   else
657 $       if (ans .eqs. "N" .or. ans .eqs. "0" .or. ans .eqs. "F") 
658 $       then
659 $           ans = "N"
660 $       else
661 $           echo4 "Input not understood please answer 'Yes' or 'No'"
662 $           goto myread
663 $       endif
664 $   endif
665 $   bool_dflt = ""
666 $ else
667 $   ans = f$edit(ans,"trim,compress")
668 $   if (ans .eqs. "") then ans = dflt
669 $   if (f$edit(ans,"upcase") .eqs. "NONE") then ans = ""
670 $ endif
671 $ if f$type(deferred_silent) .nes. ""  
672 $ then
673 $     silent := true
674 $     GOSUB Shut_up
675 $     delete/symbol deferred_silent
676 $   ENDIF
677 $ if f$type(deferred_fastread) .nes. ""
678 $ then 
679 $   fastread = 1
680 $   delete/symbol deferred_fastread
681 $ endif
682 $ RETURN
683 $!
684 $Beyond_myread:
685 $!
686 $!: create .config dir to save info across Configure sessions
687 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
688 $ THEN
689 $   CREATE/DIRECTORY [-.CONFIG]
690 $   OPEN/WRITE CONFIG [-.CONFIG]README.
691 $   WRITE CONFIG -
692       "This directory created by Configure to save information that should"
693 $   WRITE CONFIG -
694       "persist across sessions."
695 $   WRITE CONFIG ""
696 $   WRITE CONFIG -
697       "You may safely delete it if you wish."
698 $   CLOSE CONFIG
699 $ ENDIF
700 $!
701 $ IF F$TYPE(usedevel) .EQS. "" THEN usedevel := n
702 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
703 $ IF (patchlevel_h.NES."")
704 $ THEN
705 $   SEARCH 'patchlevel_h' "define","PERL_VERSION","epoch"/match=and/out=[]ver.out
706 $   IF .NOT. usedevel .AND. usedevel .NES. "define"
707 $   THEN
708 $     OPEN/READ CONFIG []ver.out
709 $     READ CONFIG line
710 $     CLOSE CONFIG
711 $     tmp = F$EDIT(line,"TRIM,COMPRESS")
712 $     xpatchlevel = F$INTEGER(F$ELEMENT(2," ",tmp))
713 $     line = xpatchlevel / 2
714 $     tmp = xpatchlevel - ( line * 2 )
715 $     IF tmp .NE. 0
716 $     THEN
717 $       echo4 "patchlevel is " + F$STRING(xpatchlevel)
718 $       cat4 SYS$INPUT:
719 $       DECK
720 *** WHOA THERE!!! ***
721
722     This is an UNSTABLE DEVELOPMENT release.
723     (The patchlevel, is odd--as opposed to even,
724      and that signifies a development release.  If you want a
725      maintenance release, you want an even-numbered release.)
726
727     Do ***NOT*** install this into production use.
728     Data corruption and crashes are possible.
729
730     It is most seriously suggested that you do not continue any further
731     unless you want to help in developing and debugging Perl.
732
733 $       EOD
734 $       bool_dflt="n"
735 $       rp="Do you really want to continue? [''bool_dflt'] "
736 $       fastread_save = fastread
737 $       fastread := FALSE
738 $       GOSUB myread
739 $       fastread = fastread_save
740 $       delete/symbol fastread_save
741 $       IF ans
742 $       THEN
743 $         echo4 "Okay, continuing."
744 $       ELSE
745 $         echo4 "Okay, bye."
746 $         DELETE/NOLOG/NOCONFIRM []ver.out;
747 $         GOTO Clean_up
748 $       ENDIF
749 $     ENDIF
750 $     DELETE/SYMBOL line
751 $     DELETE/SYMBOL tmp
752 $   ENDIF
753 $   DELETE/NOLOG/NOCONFIRM []ver.out;
754 $ ENDIF
755 $!: general instructions
756 $ needman = "true"
757 $ firsttime = "true"
758 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
759 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
760 $ THEN
761 $   messages = F$ENVIRONMENT("MESSAGE")
762 $   SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
763 $   contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
764 $   IF .NOT.($status.EQ.%X08D78053)
765 $   THEN
766 $     firsttime=""
767 $     bool_dflt = "n"
768 $     rp = "Would you like to see the instructions? [''bool_dflt'] "
769 $     GOSUB myread
770 $     if .NOT.ans THEN needman=""
771 $   ENDIF
772 $   SET MESSAGE 'messages'
773 $ ENDIF
774 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
775 $!
776 $ IF (needman)
777 $ THEN
778 $   TYPE SYS$INPUT:
779 $   DECK
780
781 This installation shell script will examine your system and ask you questions
782 to determine how the perl5 package should be installed. If you get
783 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
784 process, edit something, then restart this process as you just did.
785 Many of the questions will have default answers in square
786 brackets; typing carriage return will give you the default.
787
788 $   EOD
789 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
790 $   TYPE SYS$INPUT:
791 $   DECK
792
793 In a hurry? You may run '@Configure "-d"'.  This will bypass nearly all
794 the questions and use the computed defaults (or the previous answers provided 
795 there was already a config.sh file). Type '@Configure "-h"' for a list of 
796 options.
797
798 $   EOD
799 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
800 $   TYPE SYS$INPUT:
801 $   DECK
802
803 Much effort has been expended to ensure that this shell script will
804 run on any VMS system.  If despite that it blows up on yours, your
805 best bet is to edit Configure.com and @ it again.  Whatever problems
806 you have with Configure.com, let me (dan@sidhe.org) know how I blew
807 it.
808
809 $   EOD
810 $!This installation script affects things in two ways:
811 $!
812 $!1) it may do direct variable substitutions on some of the files included
813 $!   in this kit.
814 $!2) it builds a config.h file for inclusion in C programs.  You may edit
815 $!   any of these files as the need arises after running this script.
816 $!
817 $!If you make a mistake on a question, there is no easy way to back up to it
818 $!currently.
819 $!
820 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
821 $   IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
822 $   THEN
823 $     OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
824 $     WRITE CONFIG user 
825 $     CLOSE CONFIG
826 $   ENDIF
827 $ ENDIF  !(needman .EQS. "true")
828 $!
829 $!: see if sh knows # comments             !sfn
830 $ sharpbang = "$ "
831 $!: figure out how to guarantee sh startup !sfn
832 $!: find out where common programs are     !sfn
833 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
834 $!trylist="byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
835 $! echo "I don't know where '$file' is, and my life depends on it."
836 $! echo "Go find a public domain implementation or fix your PATH setting!"
837 $! echo ""
838 $! echo "Don't worry if any of the following aren't found..."
839 $!: determine whether symbolic links are supported !sfn
840 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
841 $!: set up the translation script tr, must be called with ./tr of course !sfn
842 $!
843 $!: Try to determine whether config.sh was made on this system
844 $!: Get old answers from old config file if Configure was run on the
845 $!: same system, otherwise use the hints.
846 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
847 $ i = 0
848 $ max = 3
849 $Config_sh_look:
850 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
851 $ i = i + 1
852 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
853 $ THEN
854 $   configshfound = F$SEARCH(config_sh)
855 $   IF (configshfound.NES."") THEN GOTO Config_sh_found
856 $ ENDIF
857 $ IF (i.LT.max) THEN GOTO Config_sh_look
858 $! genconfig.pl has "osname='VMS'"
859 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
860 $ IF (configshfound.EQS."")
861 $ THEN
862 $   config_sh = "[-]config.sh" ! the fallback default
863 $   GOTO Beyond_config_sh
864 $ ENDIF
865 $Config_sh_found:
866 $ IF F$TYPE(osname) .EQS. "" THEN osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
867 $ bool_dflt = "n"
868 $ IF F$TYPE(config_dflt) .NES. "" THEN bool_dflt = config_dflt
869 $ rp = "Shall I use ''config_sh' for default answers? [''bool_dflt'] "
870 $ GOSUB myread
871 $ IF ans
872 $ THEN
873 $   echo ""
874 $   echo "Fetching default answers from ''config_sh'..."
875 $!
876 $!  we do our own parsing of the shell-script stuff
877 $!  ...and only accept symbols if they're in the | delimited list below
878 $!
879 $   config_symbols0 ="|archlib|archlibexp|bin|binexp|builddir|cf_email|config_sh|installarchlib|installbin|installman1dir|installman3dir|"
880 $   config_symbols1 ="|installprivlib|installscript|installsitearch|installsitelib|most|oldarchlib|oldarchlibexp|osname|pager|perl_symbol|perl_verb|"
881 $   config_symbols2 ="|prefix|privlib|privlibexp|scriptdir|sitearch|sitearchexp|sitelib|sitelib_stem|sitelibexp|try_cxx|use64bitall|use64bitint|"
882 $   config_symbols3 ="|usecasesensitive|usedefaulttypes|usedevel|useieee|useithreads|usemultiplicity|usemymalloc|usedebugging_perl|useperlio|usesecurelog|"
883 $   config_symbols4 ="|usethreads|usevmsdebug|"
884 $!  
885 $   open/read CONFIG 'config_sh'
886 $   rd_conf_loop:
887 $     read/end=erd_conf_loop CONFIG line
888 $     line = f$edit(line,"trim")
889 $     if line .eqs. "" .or. f$extract(0,1,line) .eqs. "#" then goto rd_conf_loop
890 $     sym = f$element(0,"=",line)
891 $     if sym .eqs. "=" then goto rd_conf_loop
892 $     dsym = "|"+sym+"|"
893 $     k = 0
894 $     rd_ck_loop:
895 $         syms = config_symbols'k'
896 $         j = f$locate(dsym, syms)
897 $         if j .lt. f$length(syms) then goto erd_ck_loop
898 $         k = k + 1
899 $     if k .lt. 5 then goto rd_ck_loop
900 $     goto rd_conf_loop
901 $     erd_ck_loop:
902 $     val = f$element(1,"=",line)
903 $     val = f$extract(1,f$length(val)-2,val)
904 $     write sys$output "''sym' = ""''val'"""
905 $    'sym' = "''val'"
906 $   goto rd_conf_loop
907 $   erd_conf_loop:
908 $   close CONFIG
909 $   delete/symbol config_symbols0
910 $   delete/symbol config_symbols1
911 $   delete/symbol config_symbols2
912 $   delete/symbol config_symbols3
913 $   delete/symbol config_symbols4
914 $   delete/symbol sym
915 $   delete/symbol val
916 $   delete/symbol dsym
917 $   if f$type(usedebugging_perl) .nes. ""
918 $   then
919 $       useperldebug = usedebugging_perl
920 $       delete/symbol usedebugging_perl
921 $   endif
922 $!
923 $ ENDIF
924 $ if f$type(config_dflt) .nes. "" then DELETE/SYMBOL config_dflt
925 $!
926 $!we actually do not have "hints/" for VMS
927 $!     TYPE SYS$INPUT:
928 $!     DECK
929 $!
930 $!First time through, eh?  I have some defaults handy for the following systems:
931 $!
932 $!     EOD
933 $!     echo "     ","VMS_VAX"
934 $!     echo "     ","VMS_AXP"
935 $!        : Now look for a hint file osname_osvers, unless one has been
936 $!        : specified already.
937 $!     TYPE SYS$INPUT:
938 $!
939 $!You may give one or more space-separated answers, or "none" if appropriate.
940 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
941 $!
942 $!     READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
943 $!
944 $Beyond_config_sh:
945 $!
946 $!: Restore computed paths          !sfn
947 $!
948 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
949 $!
950 $ IF (osname .NES. "VMS")
951 $ THEN
952 $   echo4 "Hmm.. I wonder what ''osname' is (?)"
953 $   TYPE SYS$INPUT:
954 $   DECK
955
956 %Config-E-VMS, ERROR:
957
958            Err, you do not appear to be running VMS!
959  This procedure is intended to Configure the building of Perl for VMS.
960
961 $   EOD
962 $   bool_dflt = "n"
963 $   GOSUB myread
964 $   IF ans
965 $   THEN
966 $     echo4 "Continuing..."
967 $   ELSE
968 $     echo4 "ABORTING..."
969 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
970 $     STOP
971 $     EXIT 2 !$STATUS = "%X00000002" (error)
972 $   ENDIF
973 $ ENDIF !(osname .NES./.EQS. "VMS")
974 $!
975 $!: who configured the system
976 $ cf_by = F$EDIT(user,"LOWERCASE")
977 $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
978 $!
979 $! Peter Prymmer has seen:
980 $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-46800"  (sic)
981 $!  "SYS$TIME_ZONE" = "EDT"
982 $!
983 $! Charles Lane recommended:
984 $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
985 $!  "NEWS_TIMEZONE" = "-0500"
986 $!  "ST_TIMEZONE" = "EDT"
987 $!  "JAN_TIME_ZONE" = "EST  "
988 $!  "MULTINET_TIMEZONE" = "EST"
989 $!  "DAYLIGHT_SAVINGS"  = "1"
990 $!
991 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
992 $!   "PMDF_Timezone"
993 $!   "Multinet_Timezone"
994 $!   "TCPware_Timezone"
995 $!   "WIN$Time_Zone"
996 $!
997 $! This snippet o' DCL returns a string in default Unix `date` format,
998 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
999 $!
1000 $ MIN_TZO = -840  !units are minutes here
1001 $ MAX_TZO =  840
1002 $!
1003 $ wkday  = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
1004 $ monn   = F$CVTIME(,,"MONTH")
1005 $ mday   = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
1006 $ hour   = F$CVTIME(,,"HOUR")
1007 $ min    = F$CVTIME(,,"MINUTE")
1008 $ sec    = F$CVTIME(,,"SECOND")
1009 $ year   = F$CVTIME(,,"YEAR")
1010 $!
1011 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
1012 $ i = 0
1013 $Mon_loop:
1014 $ i = i + 1
1015 $ mon = F$ELEMENT(i,"/",months)
1016 $ IF i.LT.monn THEN GOTO Mon_loop
1017 $!
1018 $ tzneedset = "t"
1019 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
1020 $ IF systz.NES.""
1021 $ THEN
1022 $   tzhour = F$INTEGER(systz)/3600
1023 $   tzmins = F$INTEGER(systz)/60
1024 $   tzminrem = tzmins - tzhour*60
1025 $   IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem  !keeps !2ZL happy
1026 $   IF tzhour.ge.0 
1027 $   THEN signothetime = "+" 
1028 $     IF tzhour.EQ.0.AND.tzminrem.EQ.0 
1029 $     THEN direction = "on GMT/"
1030 $     ELSE direction = "east of "
1031 $     ENDIF
1032 $   ELSE signothetime = "-"
1033 $     tzhour = -1*tzhour                          !keeps !UL happy
1034 $     direction = "west of "
1035 $   ENDIF
1036 $   echo ""
1037 $   echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
1038 $   IF tzminrem.ne.0
1039 $   THEN
1040 $     tzspan = "''tzhour' hours & ''tzminrem' minutes"
1041 $   ELSE
1042 $     tzspan = "''tzhour' hours"
1043 $   ENDIF
1044 $   bool_dflt = "y"
1045 $   echo "Your system is ''tzspan' ''direction'UTC in England."
1046 $   rp = "(''systz') Is this UTC Time Zone Offset correct? [''bool_dflt'] "
1047 $   GOSUB myread
1048 $   IF ans
1049 $   THEN 
1050 $     tzneedset = "f"
1051 $     tzd = systz
1052 $     GOTO Beyond_TimeZone
1053 $   ENDIF
1054 $ ELSE
1055 $   echo ""
1056 $   echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
1057 $ ENDIF
1058 $!
1059 $TZSet:
1060 $ echo ""
1061 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
1062 $ echo "you are.  As an example Eastern (US) Standard Time is -5:00 offset, but"
1063 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
1064 $ dflt = "0:00"
1065 $ rp = "Enter the Time Zone offset: [''dflt'] "
1066 $ GOSUB myread
1067 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
1068 $ IF ans.EQS."" THEN ans = dflt
1069 $ tzhour   = F$ELEMENT(0,":","''ans'") !first
1070 $ IF tzhour.EQS."" THEN tzhour = 0
1071 $ tzhour   = F$INTEGER(tzhour)
1072 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
1073 $ IF tzminrem.NES."" 
1074 $ THEN 
1075 $   tzminrem = F$INTEGER(tzminrem)
1076 $   IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
1077 $ ELSE 
1078 $   tzminrem = 0
1079 $ ENDIF
1080 $ tzmins = tzhour*60 + tzminrem
1081 $ tzd = F$STRING(tzmins*60)
1082 $ IF tzhour .GE. 0 
1083 $ THEN
1084 $   signothetime = "+" 
1085 $ ELSE
1086 $   tzhour = -1*tzhour       !keeps !UL happy
1087 $   signothetime = "-"
1088 $ ENDIF
1089 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
1090 $ THEN
1091 $   echo ""
1092 $   echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
1093 $   goto TZSet
1094 $ ENDIF
1095 $!
1096 $Beyond_TimeZone:
1097 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
1098 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
1099 $!
1100 $!: determine the architecture name  
1101 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
1102 $! Note that DCL in VMS V5.4 does not have F$GETSYI("ARCH_NAME")
1103 $! but does have F$GETSYI("HW_MODEL").
1104 $! Please try to use either archname .EQS. "VMS_VAX" or archname .EQS. 
1105 $! "VMS_AXP" from here on to allow cross-platform configuration (e.g.
1106 $! configure a VAX build on an Alpha).
1107 $!
1108 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1109 $ THEN 
1110 $   archname = "VMS_VAX"
1111 $   otherarch = "an Alpha"
1112 $   alignbytes="8"
1113 $   arch_type = "ARCH-TYPE=__VAX__"
1114 $ ELSE
1115 $   archname = "VMS_AXP"
1116 $   otherarch = "a VAX"
1117 $   alignbytes="8"
1118 $   arch_type = "ARCH-TYPE=__AXP__"
1119 $ ENDIF
1120 $ dflt = archname
1121 $ rp = "What is your architecture name? [''archname'] "
1122 $ GOSUB myread
1123 $ IF ans.NES.""
1124 $ THEN
1125 $   ans = F$EDIT(ans,"COLLAPSE, UPCASE")
1126 $   IF (ans.NES.archname) !.AND.knowitall
1127 $   THEN
1128 $     echo4 "I'll go with ''archname' anyway..."
1129 $   ENDIF
1130 $ ENDIF
1131 $ bool_dflt = "n"
1132 $ vms_prefix = "perl_root"
1133 $ vms_prefixup = F$EDIT(vms_prefix,"UPCASE")
1134 $ rp = "Will you be sharing your ''vms_prefixup' with ''otherarch'? [''bool_dflt'] "
1135 $ GOSUB myread
1136 $ IF .NOT. ans
1137 $ THEN
1138 $   sharedperl = "N"
1139 $ ELSE
1140 $   sharedperl = "Y"
1141 $   IF (archname.EQS."VMS_AXP")
1142 $   THEN
1143 $     macros = macros + """AXE=1"","
1144 $   ENDIF
1145 $ ENDIF
1146 $!
1147 $!: is AFS running?                       !sfn
1148 $!: decide how portable to be.  Allow command line overrides. !sfn
1149 $!: set up shell script to do ~ expansion !sfn
1150 $!: expand filename                       !sfn
1151 $!: now set up to get a file name         !sfn
1152 $!
1153 $ IF F$TYPE(prefix) .EQS. ""
1154 $ THEN
1155 $   prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
1156 $   prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - "000000." - ".000000" - ".;"
1157 $   prefixbase = prefix - "]"
1158 $!  Add _ROOT to make install PERL_ROOT differ from build directory.
1159 $   prefix = prefixbase + "_ROOT.]"
1160 $ ENDIF
1161 $ src = prefix
1162 $!: determine root of directory hierarchy where package will be installed.
1163 $ dflt = prefix
1164 $ IF .NOT.silent 
1165 $ THEN 
1166 $   echo ""
1167 $   echo "By default, ''package' will be installed in ''dflt', pod"
1168 $   echo "pages under ''prefixbase'.LIB.POD], etc..., i.e. with ''dflt' as prefix for"
1169 $   echo "all installation directories."
1170 $   echo "On ''osname' the prefix is used to DEFINE the ''vms_prefixup' prior to installation"
1171 $   echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
1172 $ ENDIF
1173 $ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
1174 $ GOSUB myread
1175 $ IF ans.NES.""
1176 $ THEN 
1177 $   prefix = ans
1178 $   IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
1179 $ ELSE 
1180 $   prefix = dflt
1181 $ ENDIF
1182 $ perl_root = prefix
1183 $!
1184 $! Check here for pre-existing PERL_ROOT.
1185 $!  -> ask if removal desired.
1186 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
1187 $!  -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
1188 $!
1189 $   tmp = perl_root - ".]" + "]"
1190 $ dflt = f$parse(tmp,,,,)
1191 $   IF dflt .eqs. ""
1192 $   THEN
1193 $       echo4 "''tmp' does not yet exist."
1194 $!      create/directory 'tmp'
1195 $   ELSE
1196 $       echo4 "''tmp' already exists."
1197 $   ENDIF
1198 $!
1199 $ vms_skip_install = "true"
1200 $ bool_dflt = "y"
1201 $! echo ""
1202 $ rp = "Skip the remaining """"where install"""" questions? [''bool_dflt'] "
1203 $ GOSUB myread
1204 $ IF (.NOT.ans) THEN vms_skip_install = "false"
1205 $ IF (.NOT.vms_skip_install)
1206 $ THEN
1207 $!
1208 $!: set the prefixit variable, to compute a suitable default value
1209 $!
1210 $!: determine where private library files go
1211 $!: Usual default is /usr/local/lib/perl5.  Also allow things like 
1212 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
1213 $   IF .NOT.silent 
1214 $   THEN
1215 $     TYPE SYS$INPUT:
1216 $     DECK
1217
1218 There are some auxiliary files for perl5 that need to be put into a
1219 private library directory that is accessible by everyone.
1220 $     EOD
1221 $   ENDIF
1222 $   IF F$TYPE(privlib) .NES. ""
1223 $   THEN dflt = privlib
1224 $   ELSE dflt = "''vms_prefix':[lib]"
1225 $   ENDIF
1226 $   rp = "Pathname where the private library files will reside? " 
1227 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1228 $   GOSUB myread
1229 $   privlib = ans
1230 $!
1231 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
1232 $!
1233 $ IF F$TYPE(perl_symbol) .EQS. "" THEN perl_symbol := true
1234 $ IF F$TYPE(perl_verb) .EQS. "" THEN perl_verb = ""
1235 $ IF perl_symbol
1236 $ THEN bool_dflt = "y"
1237 $ ELSE bool_dflt = "n"
1238 $ ENDIF
1239 $ IF .NOT.silent 
1240 $ THEN 
1241 $   echo ""
1242 $   echo "You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1243 $   echo "symbol to invoke ''package', which is the usual method."
1244 $   echO "If you do not do so then you would need a DCL command verb at the"
1245 $   echo "process or the system wide level."
1246 $ ENDIF
1247 $ rp = "Invoke perl as a global symbol foreign command? [''bool_dflt'] "
1248 $ GOSUB myread
1249 $ IF (.NOT.ans) THEN perl_symbol = "false"
1250 $!
1251 $ IF (.NOT.perl_symbol)
1252 $ THEN
1253 $   IF perl_verb .EQS. "DCLTABLES"
1254 $   THEN bool_dflt = "n"
1255 $   ELSE bool_dflt = "y"
1256 $   ENDIF
1257 $   IF .NOT.silent 
1258 $   THEN 
1259 $     echo ""
1260 $     echo "Since you won't be using a symbol you must choose to put the ''packageup'"
1261 $     echo "verb in a per-process table or in the system wide DCLTABLES (which"
1262 $     echo "would require write privilege)."
1263 $   ENDIF
1264 $   rp = "Invoke perl as a per process command verb? [ ''bool_dflt' ] "
1265 $   GOSUB myread
1266 $   IF (.NOT.ans)
1267 $   THEN perl_verb = "DCLTABLES"
1268 $   ELSE perl_verb = "PROCESS"
1269 $   ENDIF
1270 $ ENDIF ! (.NOT.perl_symbol)
1271 $!
1272 $!: set the base revision
1273 $ baserev="5.0"
1274 $ revision = baserev - ".0"
1275 $!: get the patchlevel
1276 $ echo ""
1277 $ echo4 "Getting the current patchlevel..."
1278 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1279 $ IF (patchlevel_h.NES."")
1280 $ THEN
1281 $   got_patch = "false"
1282 $   got_sub   = "false"
1283 $   got_api_revision   = "false"
1284 $   got_api_version    = "false"
1285 $   got_api_subversion = "false"
1286 $   got_perl_patchlevel= "false"
1287 $   OPEN/READONLY CONFIG 'patchlevel_h' 
1288 $Patchlevel_h_loop:
1289 $   READ/END_Of_File=Close_patch/ERROR=Close_patch CONFIG line
1290 $   IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1291 $   THEN
1292 $     line = F$EDIT(line,"COMPRESS, TRIM")
1293 $     patchlevel = F$ELEMENT(2," ",line)
1294 $     got_patch = "true"
1295 $   ENDIF
1296 $   IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1297 $   THEN
1298 $     line = F$EDIT(line,"COMPRESS, TRIM")
1299 $     subversion = F$ELEMENT(2," ",line)
1300 $     got_sub = "true"
1301 $   ENDIF
1302 $   IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1303 $   THEN
1304 $     line = F$EDIT(line,"COMPRESS, TRIM")
1305 $     api_revision = F$ELEMENT(2," ",line)
1306 $     got_api_revision = "true"
1307 $   ENDIF
1308 $   IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1309 $   THEN
1310 $     line = F$EDIT(line,"COMPRESS, TRIM")
1311 $     api_version = F$ELEMENT(2," ",line)
1312 $     got_api_version = "true"
1313 $   ENDIF
1314 $   IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1315 $   THEN
1316 $     line = F$EDIT(line,"COMPRESS, TRIM")
1317 $     api_subversion = F$ELEMENT(2," ",line)
1318 $     got_api_subversion = "true"
1319 $   ENDIF
1320 $   IF ((F$LOCATE("""DEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_perl_patchlevel))
1321 $   THEN
1322 $     line = F$EDIT(line,"COMPRESS, TRIM")
1323 $     perl_patchlevel = F$ELEMENT(1,"""",line)
1324 $     perl_patchlevel = perl_patchlevel - "DEVEL"
1325 $     got_perl_patchlevel = "true"
1326 $   ENDIF
1327 $   IF (.NOT. got_patch) .OR. -
1328        (.NOT. got_sub) .OR. - 
1329        (.NOT. got_api_revision) .OR. -
1330        (.NOT. got_api_version) .OR. -
1331        (.NOT. got_api_subversion) .OR. -
1332        (.NOT. got_perl_patchlevel) -
1333       THEN GOTO Patchlevel_h_loop
1334 $Close_patch:
1335 $   CLOSE CONFIG
1336 $ ELSE
1337 $   patchlevel="0"
1338 $   subversion="0"
1339 $   api_revision="0"
1340 $   api_version="0"
1341 $   api_subversion="0"
1342 $   perl_patchlevel="0"
1343 $ ENDIF
1344 $ version_patchlevel_string = "version ''patchlevel' subversion ''subversion'"
1345 $ IF got_perl_patchlevel .AND. perl_patchlevel .NES. "0"
1346 $ THEN
1347 $   version_patchlevel_string = "''version_patchlevel_string' patch ''perl_patchlevel'"
1348 $ ENDIF
1349 $ echo "(You have ''package' ''version_patchlevel_string'.)"
1350 $!
1351 $ version = revision + "_" + patchlevel + "_" + subversion
1352 $!
1353 $ IF (.NOT.vms_skip_install)
1354 $ THEN
1355 $!: set the prefixup variable, to restore leading tilde escape !sfn
1356 $!
1357 $!: determine where public architecture dependent libraries go
1358 $   IF (.NOT.silent) 
1359 $   THEN 
1360 $     echo ""
1361 $     echo "''package' contains architecture-dependent library files.  If you are"
1362 $   ENDIF
1363 $   IF (.NOT.silent) 
1364 $   THEN
1365 $     TYPE SYS$INPUT:
1366 $     DECK
1367 sharing libraries in a heterogeneous environment, you might store
1368 these files in a separate location.  Otherwise, you can just include
1369 them with the rest of the public library files.
1370 $     EOD
1371 $   ENDIF
1372 $   IF F$TYPE(archlib) .NES. ""
1373 $   THEN dflt = archlib
1374 $   ELSE dflt = privlib - "]" + "." + archname + "." + version + "]"
1375 $   ENDIF
1376 $   rp = "Where do you want to put the public architecture-dependent libraries? "
1377 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1378 $   GOSUB myread
1379 $   archlib = ans
1380 $!
1381 $ ENDIF !%Config-I-VMS, skip "where install" questions
1382 $!
1383 $! This quotation from Configure has to be included on VMS:
1384 $!
1385 $ TYPE SYS$INPUT:
1386 $ DECK
1387
1388 There is, however, a strange, musty smell in the air that reminds me of
1389 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1390 $ EOD
1391 $ IF (.NOT.vms_skip_install)
1392 $ THEN
1393 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1394 $!
1395 $!: see if setuid scripts can be secure           !sfn
1396 $!: now see if they want to do setuid emulation   !sfn
1397 $!
1398 $!: determine where site specific libraries go.
1399 $   IF .NOT.silent 
1400 $   THEN
1401 $     TYPE SYS$INPUT:
1402 $     DECK
1403
1404 The installation process will also create a directory for
1405 site-specific extensions and modules.  Some users find it convenient
1406 to place all local files in this directory rather than in the main
1407 distribution directory.
1408 $     EOD
1409 $   ENDIF
1410 $   IF F$TYPE(sitelib) .NES. ""
1411 $   THEN dflt = sitelib
1412 $   ELSE dflt = privlib - "]" + ".SITE_PERL]"
1413 $   ENDIF
1414 $   rp = "Pathname for the site-specific library files? "
1415 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1416 $   GOSUB myread
1417 $   sitelib = ans
1418 $!
1419 $!: determine where site specific architecture-dependent libraries go.
1420 $   IF .NOT.silent 
1421 $   THEN TYPE SYS$INPUT:
1422 $     DECK
1423
1424 The installation process will also create a directory for
1425 architecture-dependent site-specific extensions and modules.
1426 $     EOD
1427 $   ENDIF
1428 $   IF F$TYPE(sitearch) .NES. ""
1429 $   THEN dflt = sitearch
1430 $   ELSE dflt = sitelib - "]" + "." + archname + "]"
1431 $   ENDIF
1432 $   rp = "Pathname for the site-specific architecture-dependent library files? "
1433 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1434 $   GOSUB myread
1435 $   sitearch = ans
1436 $!
1437 $!: determine where old public architecture dependent libraries might be
1438 $!
1439 $!: determine where public executables go
1440 $   IF F$TYPE(bin) .NES. ""
1441 $   THEN dflt = bin
1442 $!   ELSE dflt = prefix - ".]" + ".BIN]"
1443 $   ELSE dflt = "/''vms_prefix'/000000"
1444 $   ENDIF
1445 $   rp = "Pathname where the public executables will reside? "
1446 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1447 $   GOSUB myread
1448 $   bin = ans
1449 $!
1450 $!: determine where manual pages are on this system
1451 $!: What suffix to use on installed man pages
1452 $!: see if we can have long filenames
1453 $!: determine where library module manual pages go
1454 $!: What suffix to use on installed man pages
1455 $!: see what memory models we can support
1456 $!
1457 $ ELSE ! skipping "where install" questions, we must set some symbols
1458 $   IF F$TYPE(archlib).EQS."" THEN -
1459       archlib="''vms_prefix':[lib.''archname'.''version']"
1460 $   IF F$TYPE(bin) .EQS. "" THEN -
1461       bin="/''vms_prefix'/000000"
1462 $   IF F$TYPE(privlib) .EQS. "" THEN -
1463       privlib ="''vms_prefix':[lib]"
1464 $   IF F$TYPE(sitearch) .EQS. "" THEN -
1465       sitearch="''vms_prefix':[lib.site_perl.''archname']"
1466 $   IF F$TYPE(sitelib) .EQS. "" THEN -
1467       sitelib ="''vms_prefix':[lib.site_perl]"
1468 $ ENDIF !%Config-I-VMS, skip "where install" questions
1469 $!
1470 $! These derived locations can be set whether we've opted to
1471 $! skip the where install questions or not.
1472 $!
1473 $ IF F$TYPE(archlibexp) .EQS. "" THEN -
1474     archlibexp="''vms_prefix':[lib.''archname'.''version']"
1475 $ IF F$TYPE(binexp) .EQS. "" THEN -
1476     binexp ="''vms_prefix':[000000]"
1477 $ IF F$TYPE(builddir) .EQS. "" THEN -
1478     builddir ="''vms_prefix':[000000]"
1479 $ IF F$TYPE(installarchlib) .EQS. "" THEN -
1480     installarchlib="''vms_prefix':[lib.''archname'.''version']"
1481 $ IF F$TYPE(installbin) .EQS. "" THEN -
1482     installbin ="''vms_prefix':[000000]"
1483 $ IF F$TYPE(installscript) .EQS. "" THEN -
1484     installscript ="''vms_prefix':[utils]"
1485 $ IF F$TYPE(installman1dir) .EQS. "" THEN -
1486     installman1dir ="''vms_prefix':[man.man1]"
1487 $ IF F$TYPE(installman3dir) .EQS. "" THEN -
1488     installman3dir ="''vms_prefix':[man.man3]"
1489 $ IF F$TYPE(installprivlib) .EQS. "" THEN -
1490     installprivlib ="''vms_prefix':[lib]"
1491 $ IF F$TYPE(installsitearch) .EQS. "" THEN -
1492     installsitearch="''vms_prefix':[lib.site_perl.''archname']"
1493 $ IF F$TYPE(installsitelib) .EQS. "" THEN -
1494     installsitelib ="''vms_prefix':[lib.site_perl]"
1495 $ IF F$TYPE(oldarchlib) .EQS. "" THEN -
1496     oldarchlib="''vms_prefix':[lib.''archname']"
1497 $ IF F$TYPE(oldarchlibexp) .EQS. "" THEN -
1498     oldarchlibexp="''vms_prefix':[lib.''archname']"
1499 $ IF F$TYPE(privlibexp) .EQS. "" THEN -
1500     privlibexp ="''vms_prefix':[lib]"
1501 $ IF F$TYPE(scriptdir) .EQS. "" THEN -
1502     scriptdir ="''vms_prefix':[utils]"
1503 $ IF F$TYPE(sitearchexp) .EQS. "" THEN -
1504     sitearchexp ="''vms_prefix':[lib.site_perl.''archname']"
1505 $ IF F$TYPE(sitelib_stem) .EQS. "" THEN -
1506     sitelib_stem ="''vms_prefix':[lib.site_perl]"
1507 $ IF F$TYPE(sitelibexp) .EQS. "" THEN -
1508     sitelibexp ="''vms_prefix':[lib.site_perl]"
1509 $!
1510 $!: see if we need a special compiler
1511 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1512 $!
1513 $ nocc = "f"
1514 $ vms_cc_dflt = ""
1515 $ vms_cc_available = ""
1516 $!
1517 $ OPEN/WRITE CONFIG ccvms.c
1518 $ WRITE CONFIG "#ifdef __DECC"
1519 $ WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
1520 $ WRITE CONFIG "#endif"
1521 $ WRITE CONFIG "#include <stdio.h>"
1522 $ WRITE CONFIG "int main() {"
1523 $ WRITE CONFIG "#ifdef __DECC"
1524 $ WRITE CONFIG "        printf(""/DECC\n"");"
1525 $ WRITE CONFIG "#else"
1526 $ WRITE CONFIG "        printf(""/VAXC\n"");"
1527 $ WRITE CONFIG "#endif"
1528 $ WRITE CONFIG "        exit(0);"
1529 $ WRITE CONFIG "}"
1530 $ CLOSE CONFIG
1531 $!
1532 $! DEFINE SYS$ERROR _NLA0:
1533 $! DEFINE SYS$OUTPUT _NLA0:
1534 $ cc/NoObj/list=ccvms.lis ccvms.c
1535 $ tmp = $status
1536 $! DEASSIGN SYS$OUTPUT
1537 $! DEASSIGN SYS$ERROR
1538 $ IF (silent) THEN GOSUB Shut_up
1539 $ IF tmp.NE.%X10B90001
1540 $ THEN 
1541 $  IF tmp.NE.%X10000001
1542 $  THEN 
1543 $    nocc = "t"  !%X10000001 is return from gcc
1544 $    GOTO Gcc_initial_check
1545 $  ENDIF
1546 $ ENDIF
1547 $!
1548 $ GOSUB List_Parse
1549 $ IF .NOT.silent THEN echo ""
1550 $ echo "Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'" 
1551 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line) 
1552 $ THEN 
1553 $   IF .NOT.silent
1554 $   THEN 
1555 $     echo "Will try cc/decc..."
1556 $   ENDIF
1557 $   DEFINE/USER_MODE SYS$ERROR NL:
1558 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1559 $   SET NOON
1560 $   cc/decc/NoObj/list=ccvms.lis ccvms.c
1561 $   tmp = $status
1562 $   SET ON
1563 $   IF (silent) THEN GOSUB Shut_up
1564 $   IF tmp.NE.%X10B90001
1565 $   THEN
1566 $     echo "Apparently you don't have that one."
1567 $   ELSE
1568 $     GOSUB List_parse
1569 $     echo "You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1570 $     vms_cc_available = vms_cc_available + "cc/decc "
1571 $   ENDIF
1572 $ ELSE
1573 $   IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
1574 $   THEN 
1575 $     vms_cc_dflt = "/decc"
1576 $     vms_cc_available = vms_cc_available + "cc/decc "
1577 $   ENDIF
1578 $ ENDIF
1579 $!
1580 $Gcc_initial_check:
1581 $ echo "Checking for gcc"
1582 $ OPEN/WRITE CONFIG gccvers.lis
1583 $ DEFINE/USER_MODE SYS$ERROR CONFIG
1584 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1585 $ 'gcc_symbol'/noobj/version _nla0:
1586 $ tmp = $status
1587 $ IF (silent) THEN GOSUB Shut_up
1588 $ CLOSE CONFIG
1589 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1590 $ THEN
1591 $   echo "Symbol ""''gcc_symbol'"" is not defined. I guess you do not have it."
1592 $   DELETE/NOLOG/NOCONFIRM gccvers.lis;
1593 $   GOTO Cxx_initial_check
1594 $ ENDIF
1595 $ OPEN/READ CONFIG gccvers.lis
1596 $GCC_List_Read:
1597 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1598 $ GOTO GCC_List_Read
1599 $GCC_List_End:
1600 $ CLOSE CONFIG
1601 $ echo line
1602 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1603 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1604 $!
1605 $Cxx_initial_check:
1606 $!
1607 $! Do note that [vms]perl source files have a ways to go before they will 
1608 $! compile under CXX.
1609 $! In order to test Configure.com with CXX invoke it with "-Dtry_cxx" on
1610 $! the command line.
1611 $!
1612 $ IF F$TYPE(try_cxx) .EQS. "" THEN try_cxx := n
1613 $ IF try_cxx .OR. try_cxx .EQS. "define"
1614 $!
1615 $ THEN
1616 $!
1617 $ echo "Checking for CXX..."
1618 $ OPEN/WRITE CONFIG ccvms.c
1619 $ WRITE CONFIG "#include <iostream>"
1620 $ WRITE CONFIG "int main() {"
1621 $ WRITE CONFIG "#ifdef __DECCXX"
1622 $ WRITE CONFIG "        cout << __DECCXX, endl;"
1623 $ WRITE CONFIG "#else"
1624 $ WRITE CONFIG "        cout << 0,endl;"
1625 $ WRITE CONFIG "#endif"
1626 $! Todo: add G++ identifier check ??
1627 $ WRITE CONFIG "        return(0);"
1628 $ WRITE CONFIG "}"
1629 $ CLOSE CONFIG
1630 $ SET NOON
1631 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1632 $ DEFINE/USER_MODE SYS$ERROR NL:
1633 $ cxx ccvms.c
1634 $ tmp = $status
1635 $ SET ON
1636 $! success $status with:
1637 $! DEC C++ V1.1-001 on VMS VAX V5.5-2
1638 $! DEC C++ V5.6-013 on OpenVMS VAX V7.1
1639 $! DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1640 $! Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1641 $ IF tmp .eq. %X15F60001  
1642 $ THEN
1643 $! Which linker?
1644 $   SET NOON
1645 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1646 $   DEFINE/USER_MODE SYS$ERROR NL:
1647 $   link ccvms.obj
1648 $   tmp = $status
1649 $   SET ON
1650 $   ! success $status with:
1651 $   ! link && DEC C++ V1.1-001 on VMS VAX V5.5-2
1652 $   ! link && DEC C++ V5.6-013 on OpenVMS VAX V7.1
1653 $   IF tmp .eq. %X10000001
1654 $   THEN
1655 $     ld_try = "Link"
1656 $     vms_cc_available = vms_cc_available + "cxx "
1657 $     echo "CXX and LINK are available."
1658 $   ELSE
1659 $     IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1660 $     SET NOON
1661 $     DEFINE/USER_MODE SYS$OUTPUT NL:
1662 $     DEFINE/USER_MODE SYS$ERROR NL:
1663 $     cxxlink ccvms.obj
1664 $     tmp = $status
1665 $     SET ON
1666 $     ! success $status with:
1667 $     ! cxxlink && DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1668 $     ! cxxlink && Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1669 $     IF tmp .eq. %X10000001 
1670 $     THEN 
1671 $       ld_try = "cxxlink"
1672 $       vms_cc_available = vms_cc_available + "cxx "
1673 $       echo "CXX and CXXLINK are available."
1674 $     ENDIF
1675 $   ENDIF
1676 $   IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1677 $ ELSE
1678 $   echo "Nope."
1679 $ ENDIF
1680 $ DELETE/NOLOG/NOCONFIRM ccvms.c;
1681 $ IF F$SEARCH("ccvms.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.obj;
1682 $ CALL Cxx_demangler_cleanup
1683 $!
1684 $ ENDIF ! 1 .eq. 0 or 1 .eq. 1
1685 $!
1686 $CC_Cleanup:
1687 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1688 $CC_Desired:
1689 $!: see if we need a special compiler
1690 $! echo ""
1691 $ echo "Available compiler(s):"
1692 $ echo "( ''vms_cc_available')"
1693 $ IF .NOT.nocc 
1694 $ THEN
1695 $   dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
1696 $ ELSE
1697 $   dflt = gcc_symbol
1698 $ ENDIF
1699 $ rp = "Use which C compiler? [''dflt'] "
1700 $ GOSUB myread
1701 $ IF ans.NES.""
1702 $ THEN
1703 $   ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1704 $   Mcc = ans
1705 $   IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
1706 $   THEN
1707 $     Mcc = "cc/decc"
1708 $! CPQ ?
1709 $     ccname := DEC
1710 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1711 $   ENDIF
1712 $   IF F$LOCATE("cxx",F$EDIT(ans,"COLLAPSE,LOWERCASE")) .NE. F$LENGTH(ans)
1713 $   THEN
1714 $     Mcc = "cxx"
1715 $     ccname := CXX
1716 $     ld = ld_try
1717 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1718 $   ELSE ! Not_cxx
1719 $     IF Mcc.NES.dflt
1720 $     THEN
1721 $       IF F$LOCATE("dec",dflt) .NE. F$LENGTH(dflt) .or. -
1722            F$LOCATE("compaq",dflt) .NE. F$LENGTH(dflt)
1723 $       THEN 
1724 $         C_COMPILER_Replace = "CC=cc=''Mcc'"
1725 $       ELSE
1726 $         ccname := DEC
1727 $       ENDIF
1728 $     ELSE
1729 $       IF Mcc .EQS. "cc/decc"
1730 $       THEN
1731 $         ccname := DEC
1732 $         C_COMPILER_Replace = "CC=cc=''Mcc'"
1733 $       ENDIF
1734 $     ENDIF
1735 $   ENDIF
1736 $ ELSE 
1737 $   Mcc = dflt
1738 $   IF Mcc .EQS. "cc/decc"
1739 $   THEN
1740 $     ccname := DEC
1741 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1742 $   ENDIF
1743 $   IF Mcc .EQS. "gcc"
1744 $   THEN
1745 $     ccname := GCC
1746 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1747 $   ENDIF
1748 $ ENDIF
1749 $Decc_Version_check:
1750 $ ccversion=""
1751 $ IF ccname .EQS. "DEC"
1752 $ THEN
1753 $   echo ""
1754 $   echo4 "Checking for the Dec C version number..."
1755 $   OPEN/WRITE CONFIG deccvers.c
1756 $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
1757 $   WRITE CONFIG "#include <stdio.h>"
1758 $   WRITE CONFIG "int main() {"
1759 $   WRITE CONFIG "#ifdef __DECC"
1760 $   WRITE CONFIG "#ifdef __DECC_VER"
1761 $   WRITE CONFIG "        printf(""%i\n"", __DECC_VER);"
1762 $   WRITE CONFIG "#else"
1763 $   WRITE CONFIG "        printf(""%i\n"", ""1"");"
1764 $   WRITE CONFIG "#endif"
1765 $   WRITE CONFIG "#endif"
1766 $   WRITE CONFIG "        exit(0);"
1767 $   WRITE CONFIG "}"
1768 $   CLOSE CONFIG
1769 $   SET NOON
1770 $   DEFINE/USER_MODE SYS$ERROR NL:
1771 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1772 $   'Mcc' deccvers.c
1773 $   tmp = $status
1774 $   IF (silent) THEN GOSUB Shut_up
1775 $   DEFINE/USER_MODE SYS$ERROR NL:
1776 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1777 $   link deccvers.obj
1778 $   tmp = $status
1779 $   IF (silent) THEN GOSUB Shut_up
1780 $   OPEN/WRITE CONFIG deccvers.out
1781 $   DEFINE/USER_MODE SYS$ERROR CONFIG
1782 $   DEFINE/USER_MODE SYS$OUTPUT CONFIG
1783 $   mcr []deccvers.exe
1784 $   tmp = $status
1785 $   SET ON
1786 $   CLOSE CONFIG
1787 $   IF (silent) THEN GOSUB Shut_up
1788 $   OPEN/READ CONFIG deccvers.out
1789 $   READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1790 $Dec_c_cleanup:
1791 $   CLOSE CONFIG
1792 $   echo "You are using Dec C ''line'"
1793 $   ccversion = line
1794 $   Dec_C_Version = F$INTEGER(line)
1795 $   IF Dec_C_Version .GE. 60200000
1796 $   THEN
1797 $     echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
1798 $     ccflags = ccflags + "/NOANSI_ALIAS"
1799 $   ENDIF
1800 $   DELETE/NOLOG/NOCONFIRM deccvers.*;
1801 $ ENDIF
1802 $Gcc_check:
1803 $ gccversion = ""
1804 $ IF ccname .EQS. "GCC"
1805 $ THEN
1806 $   vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1807 $   vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1808 $   gcclib_olb  = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1809 $   IF gcclib_olb .EQS. "" 
1810 $   THEN 
1811 $!    These objects/libs come w/ gcc 2.7.2 for AXP:
1812 $     tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1813 $     IF tmp .NES. "" then gcclib_olb = tmp
1814 $     tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1815 $     IF tmp .NES. "" 
1816 $     THEN 
1817 $       IF gcclib_olb .EQS. "" 
1818 $       THEN gcclib_olb = tmp
1819 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1820 $       ENDIF
1821 $     ENDIF
1822 $     tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1823 $     IF tmp .NES. "" 
1824 $     THEN 
1825 $       IF gcclib_olb .EQS. "" 
1826 $       THEN gcclib_olb = tmp
1827 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1828 $       ENDIF
1829 $     ENDIF
1830 $     tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1831 $     IF tmp .NES. "" 
1832 $     THEN 
1833 $       IF gcclib_olb .EQS. "" 
1834 $       THEN gcclib_olb = tmp
1835 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1836 $       ENDIF
1837 $     ENDIF
1838 $     IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1839 $   ELSE
1840 $     gcclib_olb = gcclib_olb + "/lib"
1841 $   ENDIF
1842 $   IF   gcclib_olb .NES. "" .AND. -
1843      (vaxcrtl_olb .NES. "" .OR. -
1844       vaxcrtl_exe .NES. "" )
1845 $   THEN
1846 $     echo ""
1847 $     echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1848 $     OPEN/WRITE CONFIG gccvers.c
1849 $     WRITE CONFIG "#include <stdio.h>"
1850 $     WRITE CONFIG "int main() {"
1851 $     WRITE CONFIG "#ifdef __GNUC__"
1852 $     WRITE CONFIG "#ifdef __VERSION__"
1853 $     WRITE CONFIG "        printf(""%s\n"", __VERSION__);"
1854 $     WRITE CONFIG "#else"
1855 $     WRITE CONFIG "        printf(""%s\n"", ""1"");"
1856 $     WRITE CONFIG "#endif"
1857 $     WRITE CONFIG "#endif"
1858 $     WRITE CONFIG "        exit(0);"
1859 $     WRITE CONFIG "}"
1860 $     CLOSE CONFIG
1861 $     DEFINE SYS$ERROR _NLA0:
1862 $     DEFINE SYS$OUTPUT _NLA0:
1863 $     'Mcc' gccvers.c
1864 $     tmp = $status
1865 $     DEASSIGN SYS$ERROR _NLA0:
1866 $     DEASSIGN SYS$OUTPUT _NLA0:
1867 $     IF (silent) THEN GOSUB Shut_up
1868 $     DEFINE SYS$ERROR _NLA0:
1869 $     DEFINE SYS$OUTPUT _NLA0:
1870 $     IF vaxcrtl_exe .EQS. ""
1871 $     THEN 
1872 $       IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1873 $       THEN 
1874 $         link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1875 $         tmp = $status
1876 $       ELSE
1877 $         link gccvers.obj,'gcclib_olb'
1878 $         tmp = $status
1879 $       ENDIF
1880 $     ELSE
1881 $       OPEN/WRITE CONFIG GCCVERS.OPT
1882 $       WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1883 $       CLOSE CONFIG
1884 $       link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1885 $       tmp = $status
1886 $     ENDIF
1887 $     DEASSIGN SYS$ERROR
1888 $     DEASSIGN SYS$OUTPUT
1889 $     IF (silent) THEN GOSUB Shut_up
1890 $     OPEN/WRITE CONFIG gccvers.out
1891 $     DEFINE SYS$ERROR CONFIG
1892 $     DEFINE SYS$OUTPUT CONFIG
1893 $     mcr []gccvers.exe
1894 $     tmp = $status
1895 $     CLOSE CONFIG
1896 $     DEASSIGN SYS$OUTPUT
1897 $     DEASSIGN SYS$ERROR
1898 $     IF (silent) THEN GOSUB Shut_up
1899 $     OPEN/READ CONFIG gccvers.out
1900 $     READ/END_OF_FILE=Gcc_cleanup CONFIG line
1901 $Gcc_cleanup:
1902 $     CLOSE CONFIG
1903 $     DELETE/NOLOG/NOCONFIRM gccvers.*;
1904 $     IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1905 $     THEN 
1906 $       echo "You are not using GNU cc."
1907 $       GOTO Host_name
1908 $     ELSE 
1909 $       echo "You are using GNU cc ''line'"
1910 $       gccversion = line
1911 $       ccname := "GCC"
1912 $       C_COMPILER_Replace = "CC=cc=''Mcc'"
1913 $       GOTO Include_dirs
1914 $     ENDIF
1915 $   ENDIF
1916 $ ENDIF
1917 $Cxx_Version_check:
1918 $ IF ccname .EQS. "CXX"
1919 $ THEN
1920 $   OPEN/WRITE CONFIG cxxvers.c
1921 $   WRITE CONFIG "#include <stdio.h>"
1922 $   WRITE CONFIG "int main() {"
1923 $   WRITE CONFIG "#ifdef __DECCXX_VER"
1924 $   WRITE CONFIG "        printf(""%i\n"", __DECCXX_VER);"
1925 $   WRITE CONFIG "#else"
1926 $   WRITE CONFIG "        printf(""%i\n"", ""0"");"
1927 $   WRITE CONFIG "#endif"
1928 $   WRITE CONFIG "        return(0);"
1929 $   WRITE CONFIG "}"
1930 $   CLOSE CONFIG
1931 $   SET NOON
1932 $   DEFINE/USER_MODE SYS$ERROR NL:
1933 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1934 $   'Mcc' cxxvers.c
1935 $   tmp = $status
1936 $   SET ON
1937 $   IF (silent) THEN GOSUB Shut_up
1938 $   SET NOON
1939 $   DEFINE/USER_MODE SYS$ERROR NL:
1940 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1941 $   'ld' cxxvers.obj
1942 $   tmp = $status
1943 $   SET ON
1944 $   IF (silent) THEN GOSUB Shut_up
1945 $   OPEN/WRITE CONFIG cxxvers.out
1946 $   SET NOON
1947 $   DEFINE/USER_MODE SYS$ERROR CONFIG
1948 $   DEFINE/USER_MODE SYS$OUTPUT CONFIG
1949 $   mcr []cxxvers.exe
1950 $   tmp = $status
1951 $   SET ON
1952 $   CLOSE CONFIG
1953 $   IF (silent) THEN GOSUB Shut_up
1954 $   OPEN/READ CONFIG cxxvers.out
1955 $   READ/END_OF_FILE=Cxx_cleanup CONFIG line
1956 $Cxx_cleanup:
1957 $   CLOSE CONFIG
1958 $   DELETE/NOLOG/NOCONFIRM cxxvers.*;
1959 $   echo "You are using CXX ''line'"
1960 $   cxxversion = line
1961 $   ccversion = line
1962 $   CALL Cxx_demangler_cleanup
1963 $ ENDIF
1964 $!
1965 $Cxx_demangler_cleanup: SUBROUTINE
1966 $!
1967 $!  If we do build with CXX these demangler Dbs will be left all over.
1968 $!  However, configure.com does try to remove the [.UU] sub directory.
1969 $!  Be sure to set default to the correct place before calling this sub.
1970 $!
1971 $ SET NOON
1972 $ IF F$SEARCH("[.CXX_REPOSITORY]*.*") .NES. "" THEN DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
1973 $ IF F$SEARCH("CXX_REPOSITORY.DIR") .NES. ""
1974 $ THEN
1975 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
1976 $   DELETE/NOLOG/NOCONFIRM CXX_REPOSITORY.DIR;
1977 $ ENDIF
1978 $ SET ON
1979 $ EXIT
1980 $ ENDSUBROUTINE ! Cxx_demangler_cleanup
1981 $!
1982 $ GOTO Host_name
1983 $!
1984 $List_Parse:
1985 $ OPEN/READ CONFIG ccvms.lis
1986 $ READ CONFIG line
1987 $ IF archname .EQS. "VMS_VAX"
1988 $ THEN
1989 $   read CONFIG line
1990 $   archsufx = "VAX"
1991 $ ELSE
1992 $   archsufx = "AXP"
1993 $ ENDIF
1994 $ CLOSE CONFIG
1995 $ line = F$EDIT(line,"TRIM,COMPRESS")
1996 $ line = line - "Page 1"           ! occurs at end all compilers
1997 $ line = line - "CCVMS "           ! filename appears w/ VAXC
1998 $ line = line - "Source Listing "  ! Seen w/ AXP DECC
1999 $ tmp = F$EXTRACT(0,20,line)       !timestamp, e.g. "30-JUL-1996 21:12:54 "
2000 $ line = line - tmp
2001 $ line = F$EDIT(line,"TRIM")       !bit redundant but we're in no big hurry
2002 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
2003 $ RETURN
2004 $!
2005 $Include_dirs:
2006 $!: What should the include directory be ? (.TLB text libraries)
2007 $ dflt = gcclib_olb 
2008 $ rp = "Where are the include files you want to use? "
2009 $ IF f$length( rp + "[''dflt'] " ).gt.76
2010 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
2011 $ ELSE rp = rp + "[''dflt'] "
2012 $ ENDIF
2013 $ GOSUB myread
2014 $ usrinc = ans
2015 $!
2016 $!: see if we have to deal with yellow pages, now NIS.
2017 $!: now get the host name
2018 $Host_name:
2019 $ echo ""
2020 $ echo4 "Figuring out host name..." !>&4
2021 $ myhostname = ""
2022 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
2023 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
2024 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
2025 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
2026 $  IF myhostname.eqs."".and. -
2027       F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
2028       F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN - 
2029      myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN") 
2030 $  IF myhostname.eqs."".and. -
2031       F$TRNLNM("TCPIP$INET_HOST") .nes. "" .and. -
2032       F$TRNLNM("TCPIP$INET_DOMAIN") .nes. "" THEN - 
2033      myhostname = F$TRNLNM("TCPIP$INET_HOST") + "." + F$TRNLNM("TCPIP$INET_DOMAIN") 
2034 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
2035 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
2036 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
2037 $  IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
2038 $!: you do not want to know about this
2039 $!: verify guess
2040 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
2041 $ bool_dflt = "y"
2042 $ GOSUB myread
2043 $ IF (.not.ans)
2044 $   THEN 
2045 $     READ SYS$COMMAND/PROMPT= - 
2046  "Please type the (one word) name of your host: " ans
2047 $     myhostname = ans
2048 $ ENDIF
2049 $!: translate upper to lower if necessary
2050 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
2051 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
2052 $ IF mylowhostname.NES.myhostname
2053 $ THEN
2054 $   echo "(Normalizing case in your host name)"
2055 $   myhostname = mylowhostname
2056 $ ENDIF
2057 $!
2058 $ fp = F$LOCATE(".",myhostname)
2059 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
2060 $ IF mydomain.NES.""  !no periods in DECnet names like "MYDECNODE::"
2061 $ THEN
2062 $   rp = "What is your domain name? [''mydomain'] "
2063 $   dflt = mydomain
2064 $   GOSUB myread
2065 $   mydomain = ans
2066 $!: translate upper to lower if necessary
2067 $   mydomain = F$EDIT(mydomain,"COLLAPSE")
2068 $   mylowdomain = F$EDIT(mydomain," LOWERCASE")
2069 $   IF mylowdomain.NES.mydomain
2070 $   THEN
2071 $     echo "(Normalizing case in your domain name)"
2072 $     mydomain = mylowdomain
2073 $   ENDIF
2074 $ ENDIF
2075 $ myhostname = myhostname - mydomain
2076 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
2077 $ IF .NOT.silent 
2078 $ THEN
2079 $   TYPE SYS$INPUT:
2080 $   DECK
2081
2082 I need to get your e-mail address in Internet format if possible, i.e.
2083 something like user@host.domain. Please answer accurately since I have
2084 no easy means to double check it. The default value provided below
2085 is most probably close to the reality but may not be valid from outside
2086 your organization...
2087 $   EOD
2088 $ ENDIF
2089 $ IF F$TYPE(cf_email) .EQS. "" 
2090 $ THEN 
2091 $   dflt = "''cf_by'@''myhostname'"+"''mydomain'"
2092 $   rp = "What is your e-mail address? [''dflt'] "
2093 $   GOSUB myread
2094 $   cf_email = ans
2095 $ ENDIF
2096 $!
2097 $ IF .NOT.silent 
2098 $ THEN
2099 $   TYPE SYS$INPUT:
2100 $   DECK
2101
2102 If you or somebody else will be maintaining perl at your site, please
2103 fill in the correct e-mail address here so that they may be contacted
2104 if necessary. Currently, the "perlbug" program included with perl
2105 will send mail to this address in addition to perlbug@perl.com. You may
2106 enter "none" for no administrator.
2107 $   EOD
2108 $ ENDIF
2109 $ dflt = "''cf_email'"
2110 $ rp = "Perl administrator e-mail address [''dflt'] "
2111 $ GOSUB myread
2112 $ perladmin = ans
2113 $!
2114 $!: determine where public executable scripts go
2115 $!: determine perl absolute location
2116 $!: figure out how to guarantee perl startup
2117 $!
2118 $!: see how we invoke the C preprocessor
2119 $! echo ""
2120 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
2121 $!: Set private lib path
2122 $!: Now check and see which directories actually exist, avoiding duplicates
2123 $!: determine optimize, if desired, or use for debug flag also
2124 $!: We will not override a previous value, but we might want to
2125 $!: augment a hint file
2126 $!: the following weeds options from ccflags that are of no interest to cpp
2127 $!: flags used in final linking phase
2128 $!: Try to guess additional flags to pick up local libraries.
2129 $!: coherency check
2130 $! echo ""
2131 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
2132 $!: compute shared library extension
2133 $!: Looking for optional libraries
2134 $!: see if nm is to be used to determine whether a symbol is defined or not
2135 $!: get list of predefined functions in a handy place
2136 $!: see if we have sigaction or sigprocmask
2137 $!: see whether socketshr exists
2138 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
2139 $ THEN
2140 $   Has_socketshr     = "T"
2141 $   echo ""
2142 $   echo4 "Hmm... Looks like you have SOCKETSHR Berkeley networking support."
2143 $ ELSE
2144 $   Has_socketshr     = "F"
2145 $ ENDIF
2146 $ IF (ccname .EQS. "DEC" .AND. Dec_C_Version .GE. 50200000) .OR. -
2147      (ccname .EQS. "CXX")
2148 $ THEN
2149 $   Has_Dec_C_Sockets = "T"
2150 $   echo ""
2151 $   echo4 "Hmm... Looks like you have Dec C Berkeley networking support."
2152 $ ELSE
2153 $   Has_Dec_C_Sockets = "F"
2154 $ ENDIF
2155 $ ! Hey, we've got both. Default to Dec C, then, since it's better
2156 $ IF Has_socketshr .OR. Has_Dec_C_Sockets
2157 $ THEN
2158 $   echo ""
2159 $   echo "You have sockets available.  Which socket stack do you want to"
2160 $   echo "build into Perl?"
2161 $   IF Has_Dec_C_Sockets
2162 $   THEN
2163 $     dflt = "DECC"
2164 $   else
2165 $     dflt = "SOCKETSHR"
2166 $   endif
2167 $   rp = "Choose socket stack (NONE"
2168 $   IF Has_socketshr THEN rp = rp + ",SOCKETSHR"
2169 $   IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
2170 $   rp = rp + ") [''dflt'] "
2171 $   GOSUB myread
2172 $   Has_Dec_C_Sockets = "F"
2173 $   Has_socketshr = "F"
2174 $   ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
2175 $   IF ans.eqs."decc" then Has_Dec_C_Sockets = "T"
2176 $   IF ans.eqs."socketshr" then Has_socketshr = "T"
2177 $ ENDIF
2178 $!
2179 $!
2180 $! Ask if they want to build with VMS_DEBUG perl
2181 $ echo ""
2182 $ echo "Perl can be built to run under the VMS debugger."
2183 $ echo "You should only select this option if you are debugging"
2184 $ echo "perl itself.  This can be a useful feature if you are "
2185 $ echo "embedding perl in a program."
2186 $ bool_dflt = "n"
2187 $ if f$type(usevmsdebug) .nes. "" 
2188 $ then
2189 $   if usevmsdebug .or. usevmsdebug .eqs. "define" then bool_dflt="y"
2190 $ endif
2191 $ rp = "Build a VMS-DEBUG version of Perl? [''bool_dflt'] "
2192 $ GOSUB myread
2193 $ use_vmsdebug_perl = ans
2194 $ IF use_vmsdebug_perl
2195 $ THEN
2196 $   usevmsdebug = "define"
2197 $   macros = macros + """__DEBUG__=1"","
2198 $ ELSE
2199 $   usevmsdebug = "undef"
2200 $ ENDIF
2201 $!
2202 $! Ask if they want to build with DEBUGGING
2203 $ echo ""
2204 $ echo "Perl can be built with extra runtime debugging enabled. This"
2205 $ echo "enables the -D switch, at the cost of some performance.  It"
2206 $ echo "was mandatory on perl 5.005 and before on VMS, but is now"
2207 $ echo "optional.  If you do not generally use it you should probably"
2208 $ echo "leave this off and gain a bit of extra speed."
2209 $ bool_dflt = "y"
2210 $ if f$type(useperldebug) .nes. "" 
2211 $ then
2212 $   if f$extract(0,1,f$edit(useperldebug,"collapse,upcase")).eqs."N"  .or. useperldebug .eqs. "undef" then bool_dflt="n"
2213 $ endif
2214 $ rp = "Build a DEBUGGING version of Perl? [''bool_dflt'] "
2215 $ GOSUB myread
2216 $ use_debugging_perl = ans
2217 $!
2218 $! Ask if they want to build with MULTIPLICITY
2219 $ echo ""
2220 $ echo "Perl can be built so that multiple Perl interpreters can coexist"
2221 $ echo "within the same Perl executable."
2222 $ echo "There is some performance overhead, however, so you"
2223 $ echo "probably do not want to choose this unless you are going to be" 
2224 $ echo "doing things with embedded perl."
2225 $ bool_dflt = "n"
2226 $ if f$type(usemultiplicity) .nes. "" 
2227 $ then
2228 $   if usemultiplicity .or. usemultiplicity .eqs. "define" then bool_dflt = "y"
2229 $ endif
2230 $ rp = "Build Perl for multiplicity? [''bool_dflt'] "
2231 $ GOSUB myread
2232 $ IF ans
2233 $ THEN
2234 $   usemultiplicity="define"
2235 $ ELSE
2236 $   usemultiplicity="undef"
2237 $ ENDIF
2238 $!
2239 $! Ask if they want to build with 64-bit support
2240 $ IF (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
2241 $ THEN
2242 $   bool_dflt = "n"
2243 $   IF F$TYPE(use64bitint) .NES. "" 
2244 $   THEN
2245 $       IF use64bitint .OR. use64bitint .eqs. "define" THEN bool_dflt = "y"
2246 $   ENDIF
2247 $   echo ""
2248 $   echo "You can have native 64-bit long integers."
2249 $   echo ""
2250 $   echo "Perl can be built to take advantage of 64-bit integer types"
2251 $   echo "on some systems, which provide a much larger range for perl's"
2252 $   echo "mathematical operations.  (Note that does *not* enable 64-bit"
2253 $   echo "fileops at the moment, as Dec C doesn't do that yet)."
2254 $   echo "Choosing this option will most probably introduce binary incompatibilities."
2255 $   echo ""
2256 $   echo "If this does not make any sense to you, just accept the default ''dflt'."
2257 $   rp = "Try to use 64-bit integers, if available? [''bool_dflt'] "
2258 $   GOSUB myread
2259 $   use64bitint = ans
2260 $!
2261 $   bool_dflt = "n"
2262 $   IF F$TYPE(use64bitall) .NES. "" 
2263 $   THEN
2264 $       IF use64bitall .OR. use64bitall .eqs. "define" THEN bool_dflt = "y"
2265 $   ENDIF
2266 $   echo ""
2267 $   echo "You may also choose to try maximal 64-bitness.  It means using as much"
2268 $   echo "64-bitness as possible on the platform.  This in turn means even more"
2269 $   echo "binary incompatibilities.  On the other hand, your platform may not"
2270 $   echo "have any more 64-bitness available than what you already have chosen."
2271 $   echo ""
2272 $   echo "If this does not make any sense to you, just accept the default ''dflt'."
2273 $   rp = "Try to use maximal 64-bit support, if available? [''bool_dflt'] "
2274 $   GOSUB myread
2275 $   use64bitall=ans
2276 $   IF use64bitall .AND. .NOT. use64bitint
2277 $   THEN
2278 $     echo ""
2279 $     echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
2280 $     echo "the use of 64-bit integers."
2281 $     use64bitint="Y"
2282 $   ENDIF
2283 $ ENDIF ! AXP && >= 7.1
2284 $!
2285 $! Ask about threads, if appropriate
2286 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
2287 $ THEN
2288 $   echo ""
2289 $   echo "This version of Perl can be built with threads. While really nifty,"
2290 $   echo "they are a beta feature, and there is a speed penalty for perl"
2291 $   echo "programs if you build with threads *even if you do not use them*."
2292 $   bool_dflt = "n"
2293 $   if f$type(usethreads) .nes. "" 
2294 $   then 
2295 $       if usethreads .or. usethreads .eqs. "define" then bool_dflt="y"
2296 $   endif
2297 $   rp = "Build with threads? [''bool_dflt'] "
2298 $   GOSUB myread
2299 $   if ans
2300 $   THEN
2301 $     use_threads="T"
2302 $     ! Shall we do the 5.005-stype threads, or IThreads?
2303 $     echo "As of 5.5.640, Perl has two different internal threading"
2304 $     echo "implementations, the 5.005 version (5005threads) and an"
2305 $     echo "interpreter-based version (ithreads) that has one"
2306 $     echo "interpreter per thread.  Both are very experimental.  This"
2307 $     echo "arrangement exists to help developers work out which one"
2308 $     echo "is better."
2309 $     echo ""
2310 $     echo "If you are a casual user, you probably do not want"
2311 $     echo "interpreter-threads at this time.  There doesn't yet exist"
2312 $     echo "a way to create threads from within Perl in this model,"
2313 $     echo "i.e., ""use Thread;"" will NOT work."
2314 $     echo ""
2315 $     bool_dflt = "n"
2316 $     if f$type(useithreads) .nes. ""
2317 $     then
2318 $         if useithreads .eqs. "define" then bool_dflt="y"
2319 $     endif
2320 $     rp = "Build with Interpreter threads? [''bool_dflt'] "
2321 $     GOSUB myread
2322 $     use_ithreads=ans
2323 $     if use_ithreads 
2324 $     THEN
2325 $       use_5005_threads="N"
2326 $     ELSE
2327 $       use_5005_threads="Y"
2328 $     ENDIF
2329 $     ! Are they on VMS 7.1 on an alpha?
2330 $     if (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
2331 $     THEN
2332 $       echo ""
2333 $       echo "Threaded perl can be linked to use multiple kernel threads"
2334 $       echo "and system upcalls on VMS 7.1+ on Alpha systems.  This feature"
2335 $       echo "allows multiple threads to execute simultaneously on an SMP"
2336 $       echo "system as well as preventing a single thread from blocking"
2337 $       echo "all the threads in a program, even on a single-processor"
2338 $       echo "machine.  Unfortunately, this feature isn't safe on an"
2339 $       echo "unpatched 7.1 system (several OS patches were required when"
2340 $       echo "this procedure was written)."
2341 $       bool_dflt = "n"
2342 $       rp = "Enable multiple kernel threads and upcalls? [''bool_dflt'] "
2343 $       gosub myread
2344 $       if ans
2345 $       THEN
2346 $         Thread_Live_Dangerously = "MT=MT=1"
2347 $       ENDIF
2348 $     ENDIF
2349 $   ENDIF
2350 $ ENDIF
2351 $ IF archname .EQS. "VMS_AXP"
2352 $ THEN
2353 $! Case sensitive?
2354 $   echo ""
2355 $   echo "By default, perl (and pretty much everything else on VMS) uses"
2356 $   echo "case-insensitive linker symbols. Which is to say, when the"
2357 $   echo "underlying C code makes a call to a routine called Perl_foo in"
2358 $   echo "the source, the name in the object modules or shareable images"
2359 $   echo "is really PERL_FOO. There are some packages that use an"
2360 $   echo "embedded perl interpreter that instead require case-sensitive"
2361 $   echo "linker symbols."
2362 $   echo ""
2363 $   echo "If you have no idea what this means, and do not have"
2364 $   echo "any program requiring anything, choose the default."
2365 $   bool_dflt = be_case_sensitive
2366 $   if f$type(usecasesensitive) .nes. ""
2367 $   then
2368 $       if usecasesensitive .or. usecasesensitive .eqs. "define" then bool_dflt = "y"
2369 $       if f$extract(0,1,f$edit(usecasesensitive,"collapse,upcase")).eqs."N" .or. usecasesensitive .eqs. "undef"  then bool_dflt = "n"
2370 $   endif
2371 $   rp = "Build with case-sensitive symbols? [''bool_dflt'] "
2372 $   GOSUB myread
2373 $   be_case_sensitive = ans
2374 $! IEEE math?
2375 $   echo ""
2376 $   echo "Perl normally uses IEEE format (T_FLOAT) floating point numbers"
2377 $   echo "internally on Alpha, but if you need G_FLOAT for binary compatibility"
2378 $   echo "with an external library or existing data, you may wish to disable"
2379 $   echo "the IEEE math option."
2380 $   bool_dflt = use_ieee_math
2381 $   if f$type(useieee) .nes. "" 
2382 $   then
2383 $       if useieee .or. useieee .eqs. "define" 
2384 $       then 
2385 $         bool_dflt="y"
2386 $       else
2387 $         bool_dflt="n"
2388 $       endif
2389 $   endif
2390 $   rp = "Use IEEE math? [''bool_dflt'] "
2391 $   GOSUB myread
2392 $   use_ieee_math = ans
2393 $ ELSE
2394 $   be_case_sensitive = "n"
2395 $   use_ieee_math = "n"
2396 $ ENDIF
2397 $ useieee = "undef"
2398 $ usecasesensitive = "undef"
2399 $ if (use_ieee_math) then useieee = "define"
2400 $ if (be_case_sensitive) then usecasesensitive = "define"
2401 $! CC Flags
2402 $ echo ""
2403 $ echo "Your compiler may want other flags.  For this question you should include"
2404 $ echo "/INCLUDE=(whatever) and /DEFINE=(whatever), flags and any other flags"
2405 $ echo "or qualifiers used by the compiler."
2406 $ echo ""
2407 $ echo "To use no flags, specify the word ""none""."
2408 $ dflt = user_c_flags
2409 $ rp = "Any additional cc flags? [''dflt'] "
2410 $ GOSUB myread
2411 $ IF ans .EQS. "none" THEN ans = ""
2412 $ user_c_flags = "''ans'"
2413 $!
2414 $! Ask whether they want to use secure logical translation when tainting
2415 $ echo ""
2416 $ echo "As Perl starts up, it checks several logical names, such as"
2417 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
2418 $ echo "of its behavior.  For additional security, you may limit this"
2419 $ echo "process to executive- and kernel-mode translation when tainting"
2420 $ echo "is enabled.  In this case, logical names normally skipped when"
2421 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
2422 $ echo "If you do not choose to do this, the usual order of access modes"
2423 $ echo "is used for logical name translation."
2424 $ echo ""
2425 $ echo "This restriction does not apply to the %ENV hash or to implicit"
2426 $ echo "logical name translation during parsing of file specifications;"
2427 $ echo "these always use the normal sequence of access modes for logical"
2428 $ echo "name translation."
2429 $ bool_dflt = "y"
2430 $ if f$type(usesecurelog) .nes. "" 
2431 $ then
2432 $   if f$extract(0,1,f$edit(usesecurelog,"collapse,upcase")).eqs."N" .or. usesecurelog .eqs. "undef" then bool_dflt = "n"
2433 $ endif
2434 $ rp = "Use secure logical name translation? [''bool_dflt'] "
2435 $ GOSUB myread
2436 $ d_secintgenv  = ans
2437 $ usesecurelog = "undef"
2438 $ if (d_secintgenv) then usesecurelog = "define"
2439 $!
2440 $! Ask whether they want to default filetypes
2441 $ echo ""
2442 $ echo "When you pass the name of a program to Perl on the command line,"
2443 $ echo "it generally doesn't supply any defaults unless the -S command"
2444 $ echo "line switch is specified.  In keeping with the VMS tradition of"
2445 $ echo "default file types, however, you can configure Perl to try default"
2446 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
2447 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
2448 $ echo "finally foo.com)."
2449 $ echo ""
2450 $ echo "This is currently broken in some configurations. Only enable it if"
2451 $ echo "you know what you are doing."
2452 $ bool_dflt = "n"
2453 $ if f$type(usedefaulttypes) .nes. "" 
2454 $ then
2455 $     if usedefaulttypes .or. usedefaulttypes .eqs. "define" then bool_dflt="y"
2456 $ endif
2457 $ rp = "Always use default file types? [''bool_dflt'] "
2458 $ GOSUB myread
2459 $ d_alwdeftype = ans
2460 $ usedefaulttypes = "undef"
2461 $ if (d_alwdeftype) then usedefaulttypes = "define"
2462 $!
2463 $! Ask if they want to use perl's memory allocator
2464 $ echo ""
2465 $ echo "Perl has a built-in memory allocator that is tuned for normal"
2466 $ echo "memory usage.  It is oftentimes better than the standard system"
2467 $ echo "memory allocator.  It also has the advantage of providing memory"
2468 $ echo "allocation statistics, if you choose to enable them."
2469 $ bool_dflt = "n"
2470 $ IF F$TYPE(usemymalloc) .nes. ""
2471 $ then
2472 $   if usemymalloc .or. usemymalloc .eqs. "define" then bool_dflt = "y"
2473 $ endif
2474 $ rp = "Do you wish to attempt to use the malloc that comes with ''package'? [''bool_dflt'] "
2475 $ GOSUB myread
2476 $ mymalloc = ans
2477 $ IF mymalloc
2478 $ THEN
2479 $   IF use_debugging_perl
2480 $   THEN
2481 $     echo ""
2482 $     echo "Perl can keep statistics on memory usage if you choose to use"
2483 $     echo "them.  This is useful for debugging, but does have some"
2484 $     echo "performance overhead."
2485 $     bool_dflt = "n"
2486 $     rp = "Do you want the debugging memory allocator? [''bool_dflt'] "
2487 $     gosub myread
2488 $     use_debugmalloc = ans
2489 $   ENDIF
2490 $   ! Check which memory allocator we want
2491 $   echo ""
2492 $   echo "There are currently three different memory allocators: the"
2493 $   echo "default (which is a pretty good general-purpose memory manager),"
2494 $   echo "the TWO_POT allocator (which is optimized to save memory for"
2495 $   echo "larger allocations), and PACK_MALLOC (which is optimized to save"
2496 $   echo "memory for smaller allocations). They're all good, but if your"
2497 $   echo "usage tends towards larger chunks use TWO_POT, otherwise use"
2498 $   echo "PACK_MALLOC."
2499 $   dflt = "DEFAULT"
2500 $   rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2501 $   GOSUB myread
2502 $   if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2503 $   if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2504 $ ENDIF
2505 $!
2506 $ known_extensions = ""
2507 $ xxx = ""
2508 $ OPEN/READ CONFIG 'manifestfound'
2509 $ext_loop:
2510 $   READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
2511 $   IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
2512        F$EXTRACT(0,8,line) .NES. "vms/ext/" THEN goto ext_loop
2513 $   line = F$EDIT(line,"COMPRESS")
2514 $   line = F$ELEMENT(0," ",line)
2515 $   line_len = F$LENGTH(line)
2516 $   IF F$EXTRACT(line_len - 12,12,line) .NES. "/Makefile.PL" THEN goto ext_loop
2517 $   IF F$EXTRACT(0,4,line) .EQS. "ext/" THEN -
2518       xxx = F$EXTRACT(4,line_len - 16,line)
2519 $   IF xxx .EQS. "DynaLoader" THEN goto ext_loop     ! omit
2520 $   IF xxx .EQS. "SDBM_File/sdbm" THEN goto ext_loop ! sub extension - omit
2521 $   IF xxx .EQS. "Devel/PPPort/harness" THEN goto ext_loop ! sub extension - omit
2522 $   IF F$EXTRACT(0,8,line) .EQS. "vms/ext/" THEN -
2523       xxx = "VMS/" + F$EXTRACT(8,line_len - 20,line)
2524 $   known_extensions = known_extensions + " ''xxx'"
2525 $   goto ext_loop
2526 $end_ext:
2527 $ close CONFIG
2528 $ DELETE/SYMBOL xxx
2529 $ known_extensions = F$EDIT(known_extensions,"TRIM,COMPRESS")
2530 $ dflt = known_extensions
2531 $ IF ccname .NES. "DEC" .AND. ccname .NES. "CXX"
2532 $ THEN
2533 $   dflt = dflt - "POSIX"             ! not with VAX C or GCC
2534 $ ENDIF
2535 $ dflt = dflt - "ByteLoader"          ! needs to be ported
2536 $ dflt = dflt - "DB_File"             ! needs to be ported
2537 $ dflt = dflt - "GDBM_File"           ! needs porting/special library
2538 $ dflt = dflt - "IPC/SysV"            ! needs to be ported
2539 $ dflt = dflt - "NDBM_File"           ! needs porting/special library
2540 $ dflt = dflt - "ODBM_File"           ! needs porting/special library
2541 $ dflt = dflt - "Sys/Syslog"          ! needs porting/special library "GDBM_File macro LOG_DEBUG"
2542 $ IF .NOT. Has_socketshr .AND. .NOT. Has_Dec_C_Sockets
2543 $ THEN
2544 $   dflt = dflt - "Socket"            ! optional on VMS
2545 $ ENDIF
2546 $ IF .NOT. use_ithreads THEN dflt = dflt - "threads/shared"
2547 $ IF .NOT. use_ithreads THEN dflt = dflt - "threads"
2548 $ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2549 $!
2550 $! Ask for their default list of extensions to build
2551 $ echo ""
2552 $ echo "It is time to specify which modules you want to build into"
2553 $ echo "perl. Most of these are standard and should be chosen, though"
2554 $ echo "you might, for example, want to build GDBM_File instead of"
2555 $ echo "SDBM_File if you have the GDBM library built on your machine."
2556 $ echo ""
2557 $ echo "Which modules do you want to build into perl?"
2558 $ rp = "[''dflt'] "
2559 $ GOSUB myread
2560 $ extensions = F$EDIT(ans,"TRIM,COMPRESS")
2561 $!
2562 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2563 $ echo ""
2564 $ echo "Checking your ""make"" utilities..."
2565 $! If the 'build' that you use is not here add it and it's test
2566 $! switch to the _END_ of these strings (and increment max_build)
2567 $! (e.g. builders = builders + "/FOOMAKE" 
2568 $!       probers  = probers + " -fooVersionSwitch"
2569 $! ) & please let me know about it.
2570 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2571 $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2572 $ max_build = 7
2573 $!
2574 $ orig_dflt = "MMK"
2575 $ default_set = ""
2576 $ ok_builders = ""
2577 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2578 $ WRITE CONFIG "dont_make_anything_yet:"
2579 $ WRITE CONFIG F$FAO("!_")
2580 $ CLOSE CONFIG
2581 $ n = 0
2582 $ messages = F$ENVIRONMENT("MESSAGE")
2583 $Build_probe:
2584 $ build = F$ELEMENT(n,"/",builders)
2585 $ probe  = F$ELEMENT(n,"!",probers)
2586 $ echo "Testing whether you have ''build' on your system..."
2587 $!
2588 $! Noted with GNU Make version 3.60  that the $status and $severity
2589 $! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2590 $! $SEVERITY == "4".
2591 $!
2592 $ SET NOON
2593 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2594 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2595 $ 'build' 'probe'
2596 $ IF ($SEVERITY .EQ. 1) ! not adequate?
2597 $ THEN 
2598 $   echo "OK."
2599 $   IF (build .EQS. orig_dflt) 
2600 $   THEN 
2601 $     default_set = "TRUE"
2602 $     dflt = build
2603 $   ENDIF
2604 $   ok_builders = ok_builders + " " + build
2605 $   IF (.NOT. default_set) THEN dflt = build
2606 $ ELSE 
2607 $   echo "Nope."
2608 $ ENDIF
2609 $Reenable_messages_build:
2610 $ SET MESSAGE 'messages'
2611 $ SET ON
2612 $ on control_y then goto clean_up
2613 $ n = n + 1
2614 $ IF (n .LT. max_build) THEN GOTO Build_probe
2615 $!
2616 $ echo ""
2617 $ IF (ok_builders .NES. "") 
2618 $ THEN
2619 $   echo "Here is the list of builders you can apparently use:"
2620 $   echo "(",ok_builders," )"
2621 $   rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
2622 $   GOSUB myread
2623 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2624 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2625 $   IF (ans .EQS. "") 
2626 $   THEN build = dflt
2627 $   ELSE build = ans
2628 $   ENDIF
2629 $ ELSE
2630 $   TYPE SYS$INPUT:
2631 $   DECK
2632
2633 %Config-E-VMS, ERROR:
2634  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2635  utility of some sort and after checking my "builders" list I cannot find
2636  the symbol or command you use on your system to compile programs.
2637
2638 $   EOD
2639 $   READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
2640 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2641 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2642 $   IF (ans .EQS. "") 
2643 $   THEN build = dflt
2644 $     echo "I do not know where ""make"" is, and my life depends on it."
2645 $     echo "Go find a make program or fix your DCL$PATH setting!"
2646 $     echo "ABORTING..."
2647 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
2648 $     STOP
2649 $     EXIT 2 !$STATUS = "%X00000002" (error)
2650 $   ELSE 
2651 $     build = ans
2652 $   ENDIF
2653 $ ENDIF
2654 $!
2655 $ DELETE/NOLOG Makefile.;
2656 $ GOTO Beyond_open
2657 $Open_error:
2658 $ TYPE SYS$INPUT:
2659 $ DECK
2660
2661  There seems to be trouble. I just tried to create a file in
2662 $ EOD
2663 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2664 $ TYPE SYS$INPUT:
2665 $ DECK
2666  but was unsuccessful. I am stopping now. Please check that directories'
2667  PROTECTION bits. I will leave you in the directory where you started
2668  Configure.com
2669 $ EOD
2670 $ echo4 "ABORTING..."
2671 $ GOTO Clean_up
2672 $ STOP
2673 $ EXIT
2674 $!
2675 $Beyond_open:
2676 $! echo " Very well I will proceed with ""''build'"""
2677 $ make = F$EDIT(build,"UPCASE")
2678 $!
2679 $!: locate the preferred pager for this system
2680 $!pagers = "most|more|less|type/page"
2681 $ dflt = "type/page"
2682 $! assume that the presence of a most symbol indicates the presence
2683 $! of the pager.
2684 $ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
2685 $ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
2686 $ rp="What pager is used on your system? [''dflt'] "
2687 $ GOSUB myread
2688 $ pager = ans
2689 $!
2690 $! update [.vms]config.vms here
2691 $!
2692 $! update makefile here
2693 $! echo4 "Updating makefile..."
2694 $!
2695 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2696 $ THEN 
2697 $   makefile    = ""               !wrt MANIFEST dir
2698 $   UUmakefile  = "[-]DESCRIP.MMS" !wrt CWD dir
2699 $   DEFmakefile = "DESCRIP.MMS"    !wrt DEF dir (?)
2700 $   Makefile_SH = "descrip_mms.template"
2701 $ ELSE
2702 $   makefile    = " -f Makefile."  !wrt MANIFEST dir
2703 $   UUmakefile  = "[-]Makefile."   !wrt CWD dir
2704 $   DEFmakefile = "Makefile."      !wrt DEF dir (?)
2705 $   Makefile_SH = "Makefile.in"
2706 $ ENDIF
2707 $!
2708 $ IF macros .NES. "" 
2709 $ THEN
2710 $   tmp = F$LENGTH(macros)
2711 $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2712 $   macros = "/macro=(" + macros  + ")"
2713 $ ENDIF
2714 $! Build up the extra C flags
2715 $!
2716 $ IF use_ieee_math
2717 $ THEN
2718 $   extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2719 $ ENDIF
2720 $ IF be_case_sensitive
2721 $ THEN
2722 $   extra_flags = "''extra_flags'" + "/Names=As_Is"
2723 $ ENDIF
2724 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
2725 $!
2726 $ min_pgflquota = "100000"
2727 $ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
2728 $ IF pgflquota .LES. min_pgflquota
2729 $ THEN
2730 $   echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
2731 $   READ SYS$COMMAND/PROMPT="Continue? [n] " ans
2732 $   IF ans
2733 $   THEN
2734 $     echo4 "Continuing..."
2735 $   ELSE
2736 $     echo4 "ABORTING..."
2737 $     GOTO Clean_up
2738 $   ENDIF
2739 $ ENDIF
2740 $!
2741 $! PerlIO abstraction
2742 $!
2743 $ bool_dflt = "y"
2744 $ IF F$TYPE(useperlio) .NES. ""
2745 $ then
2746 $   if f$extract(0,1,f$edit(useperlio,"collapse,upcase")) .eqs. "N" .or. useperlio .eqs. "undef" then bool_dflt = "n"
2747 $ endif
2748 $ IF .NOT. silent
2749 $ THEN
2750 $   echo "Previous versions of ''package' used the standard IO mechanisms as"
2751 $   TYPE SYS$INPUT:
2752 $   DECK
2753 defined in <stdio.h>.  Versions 5.003_02 and later of perl allow
2754 alternate IO mechanisms via the PerlIO abstraction layer, but the
2755 stdio mechanism is still available if needed.  The abstraction layer
2756 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
2757 Using PerlIO with sfio may cause problems with some extension modules.
2758
2759 $   EOD
2760 $   echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2761 $ ENDIF
2762 $ rp = "Use the PerlIO abstraction layer? [''bool_dflt'] "
2763 $ GOSUB myread
2764 $ IF ans
2765 $ THEN
2766 $   useperlio = "define"
2767 $ ELSE
2768 $   echo "Ok, doing things the stdio way."
2769 $   useperlio = "undef"
2770 $ ENDIF
2771 $!
2772 $ echo ""
2773 $ echo4 "Checking the C run-time library."
2774 $!
2775 $! Former SUBCONFIGURE.COM
2776 $!
2777 $!  - build a config.sh for VMS Perl.
2778 $!  - use built config.sh to take config_h.SH -> config.h
2779 $!  - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
2780 $!              vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
2781 $!              vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
2782 $!
2783 $! Note for folks from other platforms changing things in here:
2784 $!
2785 $!   Fancy changes (based on compiler capabilities or VMS version or
2786 $!   whatever) are tricky, so go ahead and punt on those.
2787 $!
2788 $!   Simple changes, though (say, always setting something to 1, or undef,
2789 $!   or something like that) are straightforward.  Adding a new constant 
2790 $!   item for the ultimately created config.sh requires at least one 
2791 $!   (possibly more) line(s) to this file.
2792 $!
2793 $!   Add a line in the format:
2794 $!
2795 $!     $ WC "foo='undef'"
2796 $!
2797 $!   somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
2798 $!   and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
2799 $!   is sorted ASCII and corresponds to the output of config.sh in the 
2800 $!   Bourne shell version of Configure).
2801 $!   Be very careful with quoting, as it can be tricky.
2802 $!   For example if instead of a constant string like 'undef' or 'define' 
2803 $!   you wanted to add something to VMS's config.sh that looks like:
2804 $!
2805 $!     blank_string=''
2806 $!
2807 $!   then add a line that looks like this before the 
2808 $!   '##END WRITE NEW CONSTANTS HERE##' tagged line:
2809 $!
2810 $!     $ WC "blank_string='" + "'"
2811 $!
2812 $!   (+ is the string concatenator and "''var'" has the effect 
2813 $!    of "${var}" in perl or sh, but "'const'" is not interpolated).
2814 $!
2815 $!   Note that unitialized variables, such as a line like:
2816 $!
2817 $!     $ WC "new_var='" + new_var + "'"
2818 $!
2819 $!   should be avoided unless new_var has a value assigned prior 
2820 $!   to that line (think of perl's -w warnings).
2821 $!
2822 $!     %DCL-W-UNDSYM, undefined symbol - check validity and spelling
2823 $!     \NEW_VAR\
2824 $!
2825 $!
2826 $ vms_ver = F$EXTRACT(1,3, osvers)
2827 $ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
2828 $ MCC = f$edit(mcc, "UPCASE")
2829 $ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
2830 $ IF ccname .EQS. "DEC"
2831 $ THEN
2832 $   Checkcc := "''Mcc'/prefix=all"
2833 $ ELSE
2834 $   IF ccname .EQS. "CXX"
2835 $   THEN
2836 $     Checkcc := cxx
2837 $   ELSE
2838 $     Checkcc := "''Mcc'"
2839 $   ENDIF
2840 $ ENDIF
2841 $ ccflags = ccflags + extra_flags
2842 $ IF be_case_sensitive
2843 $ THEN
2844 $   d_vms_be_case_sensitive = "define"
2845 $ ELSE
2846 $   d_vms_be_case_sensitive = "undef"
2847 $ ENDIF
2848 $! Some constant defaults.
2849 $ hwname = f$getsyi("HW_NAME")
2850 $ myname = myhostname
2851 $ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
2852 $!
2853 $ ccdlflags=""
2854 $ cccdlflags=""
2855 $!
2856 $ IF use64bitint .OR. use64bitint .EQS. "define"
2857 $ THEN
2858 $   use64bitint = "define"
2859 $   uselargefiles = "define"
2860 $   uselongdouble = "define"
2861 $   alignbytes="16"
2862 $   usemorebits = "define"
2863 $   ivdformat="""Ld"""
2864 $   uvuformat="""Lu"""
2865 $   uvoformat="""Lo"""
2866 $   uvxformat="""Lx"""
2867 $   uvXUformat="""LX"""
2868 $ ELSE
2869 $   use64bitint = "undef"
2870 $   uselargefiles = "undef"
2871 $   uselongdouble = "undef"
2872 $   usemorebits = "undef"
2873 $   ivdformat="""ld"""
2874 $   uvuformat="""lu"""
2875 $   uvoformat="""lo"""
2876 $   uvxformat="""lx"""
2877 $   uvXUformat="""lX"""
2878 $ ENDIF
2879 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
2880 $ THEN
2881 $   nveformat="""Le"""
2882 $   nvfformat="""Lf"""
2883 $   nvgformat="""Lg"""
2884 $ ELSE
2885 $   nveformat="""e"""
2886 $   nvfformat="""f"""
2887 $   nvgformat="""g"""
2888 $ ENDIF
2889 $ IF use64bitall .OR. use64bitall .EQS. "define"
2890 $ THEN
2891 $   use64bitall = "define"
2892 $ ELSE
2893 $   use64bitall = "undef"
2894 $ ENDIF
2895 $!
2896 $ usemymalloc = "undef"
2897 $ if mymalloc then usemymalloc = "define"
2898 $!
2899 $ perl_cc=Mcc
2900 $!
2901 $ IF (sharedperl .AND. archname .EQS. "VMS_AXP")
2902 $ THEN
2903 $   obj_ext=".abj"
2904 $   so="axe"
2905 $   dlext="axe"
2906 $   exe_ext=".axe"
2907 $   lib_ext=".alb"
2908 $ ELSE
2909 $   obj_ext=".obj"
2910 $   so="exe"
2911 $   dlext="exe"
2912 $   exe_ext=".exe"
2913 $   lib_ext=".olb"
2914 $ ENDIF
2915 $ dlobj="dl_vms''obj_ext'"
2916 $!
2917 $ cppstdin="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
2918 $ cppminus=" "
2919 $ cpprun="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
2920 $ cpplast=" "
2921 $!
2922 $ timetype="time_t"
2923 $ signal_t="void"
2924 $ stdchar="char"
2925 $!
2926 $ IF mymalloc
2927 $ THEN d_mymalloc="define"
2928 $ ELSE d_mymalloc="undef"
2929 $ ENDIF
2930 $!
2931 $ usedl="define"
2932 $ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
2933 $ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
2934 $!
2935 $ IF ((Use_Threads) .AND. (vms_ver .LES. "6.2"))
2936 $ THEN
2937 $   libs="SYS$SHARE:CMA$LIB_SHR.EXE/SHARE SYS$SHARE:CMA$RTL.EXE/SHARE SYS$SHARE:CMA$OPEN_LIB_SHR.exe/SHARE SYS$SHARE:CMA$OPEN_RTL.exe/SHARE"
2938 $ ELSE
2939 $   libs=" "
2940 $ ENDIF
2941 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
2942 $ THEN
2943 $   libc="(DECCRTL)"
2944 $ ELSE
2945 $   libc=" "
2946 $ ENDIF
2947 $!
2948 $! perllibs should be libs with all non-core libs (such as gdbm) removed.
2949 $!
2950 $ perllibs=libs
2951 $!
2952 $! Are we 64 bit?
2953 $!
2954 $ IF use64bitint .OR. use64bitint .EQS. "define"
2955 $ THEN
2956 $   d_PRId64 = "define"
2957 $   d_PRIEUldbl = "define"
2958 $   d_PRIFUldbl = "define"
2959 $   d_PRIGUldbl = "define"
2960 $   d_PRIeldbl = "define"
2961 $   d_PRIfldbl = "define"
2962 $   d_PRIgldbl = "define"
2963 $   d_PRIu64 = "define"
2964 $   d_PRIo64 = "define"
2965 $   d_PRIx64 = "define"
2966 $   d_PRIXU64 = "define"
2967 $   sPRId64 = """Ld"""
2968 $   sPRIEUldbl = """LE"""
2969 $   sPRIFUldbl = """LF"""
2970 $   sPRIGUldbl = """LG"""
2971 $   sPRIXU64 = """LX"""
2972 $   sPRIeldbl = """Le"""
2973 $   sPRIfldbl = """Lf"""
2974 $   sPRIgldbl = """Lg"""
2975 $   sPRIi64 = """Li"""
2976 $   sPRIo64 = """Lo"""
2977 $   sPRIu64 = """Lu"""
2978 $   sPRIx64 = """Lx"""
2979 $   d_quad = "define"
2980 $   quadtype = "long long"
2981 $   uquadtype = "unsigned long long"
2982 $   quadkind  = "QUAD_IS_LONG_LONG"
2983 $   d_frexpl = "define"
2984 $   d_isnan = "define"
2985 $   d_isnanl = "define"
2986 $   d_modfl = "define"
2987 $ ELSE
2988 $   d_PRId64 = "undef"
2989 $   d_PRIEUldbl = "define"
2990 $   d_PRIFUldbl = "define"
2991 $   d_PRIGUldbl = "define"
2992 $   d_PRIXU64 = "undef"
2993 $   d_PRIeldbl = "define"
2994 $   d_PRIfldbl = "undef"
2995 $   d_PRIgldbl = "undef"
2996 $   d_PRIu64 = "undef"
2997 $   d_PRIo64 = "undef"
2998 $   d_PRIx64 = "undef"
2999 $   sPRId64 = ""
3000 $   sPRIEUldbl = """E"""
3001 $   sPRIFUldbl = """F"""
3002 $   sPRIGUldbl = """G"""
3003 $   sPRIXU64 = """lX"""
3004 $   sPRIeldbl = """e"""
3005 $   sPRIfldbl = """f"""
3006 $   sPRIgldbl = """g"""
3007 $   sPRIi64 = ""
3008 $   sPRIo64 = ""
3009 $   sPRIu64 = ""
3010 $   sPRIx64 = ""
3011 $   d_quad = "undef"
3012 $   quadtype = "long"
3013 $   uquadtype = "unsigned long"
3014 $   quadkind  = "QUAD_IS_LONG"
3015 $   d_frexpl = "undef"
3016 $   d_isnan = "undef"
3017 $   d_isnanl = "undef"
3018 $   d_modfl = "undef"
3019 $ ENDIF
3020 $ d_SCNfldbl = d_PRIfldbl
3021 $ sSCNfldbl = sPRIfldbl ! expect consistency
3022 $!
3023 $! Now some that we build up
3024 $!
3025 $ IF Use_Threads
3026 $ THEN
3027 $   IF use_5005_threads
3028 $   THEN
3029 $     arch = "''arch'-thread"
3030 $     archname = "''archname'-thread"
3031 $     d_old_pthread_create_joinable = "undef"
3032 $     old_pthread_create_joinable = " "
3033 $     use5005threads = "define"
3034 $     useithreads = "undef"
3035 $   ELSE
3036 $     arch = "''arch'-ithread"
3037 $     archname = "''archname'-ithread"
3038 $     d_old_pthread_create_joinable = "undef"
3039 $     old_pthread_create_joinable = " "
3040 $     use5005threads = "undef"
3041 $     useithreads = "define"
3042 $   ENDIF
3043 $ ELSE
3044 $   d_old_pthread_create_joinable = "undef"
3045 $   old_pthread_create_joinable = " "
3046 $   use5005threads = "undef"
3047 $   useithreads = "undef"
3048 $ ENDIF
3049 $!
3050 $! Some that we need to invoke the compiler for
3051 $!
3052 $!
3053 $! handy construction aliases/symbols
3054 $!
3055 $ OS := "open/write CONFIG []try.c"
3056 $ WS := "write CONFIG"
3057 $ CS := "close CONFIG"
3058 $ DS := "delete/nolog/noconfirm []try.*;*"
3059 $ Needs_Opt := N
3060 $ good_compile = %X10B90001
3061 $ IF ccname .EQS. "GCC"
3062 $ THEN
3063 $   open/write OPTCHAN []try.opt
3064 $   write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3065 $   write OPTCHAN "Sys$Share:VAXCRTL/Share"
3066 $   Close OPTCHAN
3067 $   Needs_Opt := Y
3068 $   good_compile = %X10000001
3069 $ ENDIF
3070 $ IF ccname .EQS. "CXX"
3071 $ THEN
3072 $   good_compile = %X15F60001
3073 $ ENDIF
3074 $ good_link = %X10000001
3075 $ tmp = "" ! null string default
3076 $!
3077 $ GOTO beyond_compile_ok
3078 $!
3079 $! Check for type sizes 
3080 $!
3081 $type_size_check: 
3082 $!
3083 $ OS
3084 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3085 $ WS "#include <stdlib.h>"
3086 $ WS "#endif"
3087 $ WS "#include <stdio.h>"
3088 $ WS "int main()"
3089 $ WS "{"
3090 $ WS "printf(""%d\n"", sizeof(''tmp'));"
3091 $ WS "exit(0);"
3092 $ WS "}"
3093 $ CS
3094 $ GOSUB compile
3095 $ RETURN
3096 $!
3097 $!: locate header file
3098 $findhdr:
3099 $!
3100 $ OS
3101 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3102 $ WS "#include <stdlib.h>"
3103 $ WS "#endif"
3104 $ WS "#include <stdio.h>"
3105 $ WS "#include <''tmp'>"
3106 $ WS "int main()"
3107 $ WS "{"
3108 $ WS "printf(""define\n"");"
3109 $ WS "exit(0);"
3110 $ WS "}"
3111 $ CS
3112 $ GOSUB link_ok
3113 $ RETURN
3114 $!
3115 $!: define an alternate in-header-list? function
3116 $inhdr:
3117 $!
3118 $ GOSUB findhdr
3119 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3120 $ THEN
3121 $   echo4 "<''tmp'> found."
3122 $   tmp = "define"
3123 $ ELSE
3124 $   echo4 "<''tmp'> NOT found."
3125 $   tmp = "undef"
3126 $ ENDIF
3127 $ RETURN
3128 $!
3129 $!: define an is-in-libc? function
3130 $inlibc: 
3131 $ GOSUB link_ok
3132 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3133 $ THEN
3134 $   echo4 "''tmp'() found."
3135 $   tmp = "define"
3136 $ ELSE
3137 $   echo4 "''tmp'() NOT found."
3138 $   tmp = "undef"
3139 $ ENDIF
3140 $ RETURN
3141 $!
3142 $!: define a shorthand compile call
3143 $compile:
3144 $ GOSUB link_ok
3145 $just_mcr_it:
3146 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3147 $ THEN
3148 $   OPEN/WRITE CONFIG []try.out
3149 $   DEFINE/USER_MODE SYS$ERROR CONFIG
3150 $   DEFINE/USER_MODE  SYS$OUTPUT CONFIG
3151 $   MCR []try.exe
3152 $   CLOSE CONFIG
3153 $   OPEN/READ CONFIG []try.out
3154 $   READ CONFIG tmp
3155 $   CLOSE CONFIG
3156 $   DELETE/NOLOG/NOCONFIRM []try.out;
3157 $   DELETE/NOLOG/NOCONFIRM []try.exe;
3158 $ ELSE
3159 $   tmp = "" ! null string default
3160 $ ENDIF
3161 $ RETURN
3162 $!
3163 $link_ok:
3164 $ GOSUB compile_ok
3165 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3166 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3167 $ SET NOON
3168 $ IF Needs_Opt
3169 $ THEN
3170 $   'ld' try.obj,try.opt/opt
3171 $   link_status = $status
3172 $ ELSE
3173 $   'ld' try.obj
3174 $   link_status = $status
3175 $ ENDIF
3176 $ SET ON
3177 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3178 $ RETURN
3179 $!
3180 $!: define a shorthand compile call for compilations that should be ok.
3181 $compile_ok:
3182 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3183 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3184 $ SET NOON
3185 $ 'Checkcc' try.c
3186 $ compile_status = $status
3187 $ SET ON
3188 $ DELETE/NOLOG/NOCONFIRM try.c;
3189 $ RETURN
3190 $!
3191 $beyond_compile_ok:
3192 $!
3193 $! Check for __STDC__
3194 $!
3195 $ OS
3196 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3197 $ WS "#include <stdlib.h>"
3198 $ WS "#endif"
3199 $ WS "#include <stdio.h>"
3200 $ WS "int main()"
3201 $ WS "{"
3202 $ WS "#ifdef __STDC__"
3203 $ WS "printf(""42\n"");"
3204 $ WS "#else"
3205 $ WS "printf(""1\n"");"
3206 $ WS "#endif"
3207 $ WS "exit(0);"
3208 $ WS "}"
3209 $ CS
3210 $ GOSUB compile
3211 $ cpp_stuff=tmp
3212 $ IF F$INTEGER(tmp) .eq. 42
3213 $ THEN
3214 $   echo4 "Your C compiler and pre-processor defines the symbol:"
3215 $   echo4 "__STDC__"
3216 $ ENDIF
3217 $!
3218 $! Check for double size
3219 $!
3220 $ echo4 "Checking to see how big your double precision numbers are..."
3221 $ tmp="double"
3222 $ GOSUB type_size_check
3223 $ doublesize = tmp
3224 $ echo "Your double is ''doublesize' bytes long."
3225 $!
3226 $! Check for long double size
3227 $!
3228 $ OS
3229 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3230 $ WS "#include <stdlib.h>"
3231 $ WS "#endif"
3232 $ WS "#include <stdio.h>"
3233 $ WS "int main()"
3234 $ WS "{"
3235 $ WS "printf(""%d\n"", sizeof(long double));"
3236 $ WS "exit(0);"
3237 $ WS "}"
3238 $ CS
3239 $ echo4 "Checking to see if you have long double..."
3240 $ GOSUB link_ok
3241 $ IF link_status .NE. good_link
3242 $ THEN
3243 $   longdblsize="0"
3244 $   d_longdbl="undef"
3245 $   echo "You do not have long double."
3246 $ ELSE
3247 $   echo "You have long double."
3248 $   echo4 "Checking to see how big your long doubles are..."
3249 $   GOSUB just_mcr_it
3250 $   longdblsize = tmp
3251 $   d_longdbl = "define"
3252 $   echo "Your long doubles are ''longdblsize' bytes long."
3253 $ ENDIF
3254 $!
3255 $!: check for long long
3256 $ OS
3257 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3258 $ WS "#include <stdlib.h>"
3259 $ WS "#endif"
3260 $ WS "#include <stdio.h>"
3261 $ WS "int main()"
3262 $ WS "{"
3263 $ WS "printf(""%d\n"", sizeof(long long));"
3264 $ WS "exit(0);"
3265 $ WS "}"
3266 $ CS
3267 $ echo4 "Checking to see if you have long long..."
3268 $ GOSUB link_ok
3269 $ IF link_status .NE. good_link
3270 $ THEN
3271 $   longlongsize="0"
3272 $   d_longlong="undef"
3273 $   echo "You do not have long long."
3274 $ ELSE
3275 $   echo "You have long long."
3276 $   echo4 "Checking to see how big your long longs are..."
3277 $   GOSUB just_mcr_it
3278 $   longlongsize = tmp
3279 $   d_longlong = "define"
3280 $   echo "Your long longs are ''longlongsize' bytes long."
3281 $ ENDIF
3282 $!
3283 $! Check the prototype for getgid
3284 $!
3285 $ echo "Looking for the type for group ids returned by getgid()."
3286 $ OS
3287 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3288 $ WS "#include <stdlib.h>"
3289 $ WS "#endif"
3290 $ WS "#include <stdio.h>"
3291 $ WS "#include <types.h>"
3292 $ WS "int main()"
3293 $ WS "{"
3294 $ WS "gid_t foo;"
3295 $ WS "exit(0);"
3296 $ WS "}"
3297 $ CS
3298 $ GOSUB compile_ok
3299 $ IF compile_status .NE. good_compile
3300 $ THEN
3301 $!   Okay, gid_t failed. Must be unsigned int
3302 $   gidtype = "unsigned int"
3303 $   echo4 "assuming ""''gidtype'""."
3304 $ ELSE
3305 $   gidtype = "gid_t"
3306 $   echo4 "gid_t found."
3307 $ ENDIF
3308 $!
3309 $! Check to see if we've got dev_t
3310 $!
3311 $ echo "Looking for the type for dev."
3312 $ OS
3313 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3314 $ WS "#include <stdlib.h>"
3315 $ WS "#endif"
3316 $ WS "#include <stdio.h>"
3317 $ WS "#include <types.h>"
3318 $ WS "int main()"
3319 $ WS "{"
3320 $ WS "dev_t foo;"
3321 $ WS "exit(0);"
3322 $ WS "}"
3323 $ CS
3324 $ GOSUB compile_ok
3325 $ IF compile_status .NE. good_compile
3326 $ THEN
3327 $!   Okay, dev_t failed. Must be unsigned int
3328 $   devtype = "unsigned int"
3329 $   echo4 "assuming ""''devtype'""."
3330 $ ELSE
3331 $   devtype = "dev_t"
3332 $   echo4 "dev_t found."
3333 $ ENDIF
3334 $!
3335 $! Check to see if we've got unistd.h (which we ought to, but you never know)
3336 $!
3337 $ i_netdb = "undef"
3338 $ tmp = "unistd.h"
3339 $ GOSUB inhdr
3340 $ i_unistd = tmp
3341 $!
3342 $!: see if this is a libutil.h system
3343 $!
3344 $ tmp = "libutil.h"
3345 $ GOSUB inhdr
3346 $ i_libutil = tmp
3347 $!
3348 $! Check to see if we've got shadow.h (probably not, but...)
3349 $!
3350 $ tmp = "shadow.h"
3351 $ GOSUB inhdr
3352 $ i_shadow = tmp
3353 $!
3354 $! Check to see if we've got socks.h (probably not, but...)
3355 $!
3356 $ tmp = "socks.h"
3357 $ GOSUB inhdr
3358 $ i_socks = tmp
3359 $!
3360 $! Check the prototype for select
3361 $!
3362 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3363 $ THEN
3364 $   OS
3365 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3366 $   WS "#include <stdlib.h>"
3367 $   WS "#endif"
3368 $   WS "#include <stdio.h>"
3369 $   WS "#include <types.h>"
3370 $   IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3371 $   IF Has_Socketshr
3372 $   THEN
3373 $     WS "#include <socketshr.h>"
3374 $   ELSE
3375 $     WS "#include <time.h>"
3376 $     WS "#include <socket.h>"
3377 $   ENDIF
3378 $   WS "int main()"
3379 $   WS "{"
3380 $   WS "fd_set *foo;"
3381 $   WS "int bar;"
3382 $   WS "foo = NULL;"
3383 $   WS "bar = select(2, foo, foo, foo, NULL);"
3384 $   WS "exit(0);"
3385 $   WS "}"
3386 $   CS
3387 $   GOSUB compile_ok
3388 $   IF compile_status .NE. good_compile
3389 $   THEN
3390 $!   Okay, select failed.  Must be an int *
3391 $     selecttype = "int *"
3392 $     echo4 "select() NOT found."
3393 $   ELSE
3394 $     selecttype="fd_set *"
3395 $     echo4 "select() found."
3396 $   ENDIF
3397 $ ELSE
3398 $   ! No sockets, so stick in an int * : no select, so pick a harmless default
3399 $   selecttype = "int *"
3400 $ ENDIF
3401 $!
3402 $! Check to see if fd_set exists
3403 $!
3404 $ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3405 $ OS
3406 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3407 $ WS "#include <stdlib.h>"
3408 $ WS "#endif"
3409 $ WS "#include <stdio.h>"
3410 $ WS "#include <types.h>"
3411 $ IF Has_Socketshr
3412 $ THEN
3413 $   WS "#include <socketshr.h>"
3414 $ ENDIF
3415 $ IF Has_Dec_C_Sockets
3416 $ THEN
3417 $   WS "#include <time.h>"
3418 $   WS "#include <socket.h>"
3419 $ ENDIF
3420 $ WS "int main()"
3421 $ WS "{"
3422 $ WS "fd_set *foo;"
3423 $ WS "int bar;"
3424 $ WS "exit(0);"
3425 $ WS "}"
3426 $ CS
3427 $ GOSUB compile_ok
3428 $ IF compile_status .ne. good_compile
3429 $ THEN
3430 $!  Okay, fd_set failed. Must not exist
3431 $   d_fd_set = "undef"
3432 $   echo4 "Hmm, your compiler has some difficulty with fd_set."
3433 $ ELSE
3434 $   d_fd_set="define"
3435 $   echo4 "Well, your system knows about the normal fd_set typedef..."
3436 $ ENDIF
3437 $!
3438 $! Check for inttypes.h
3439 $!
3440 $ tmp = "inttypes.h"
3441 $ GOSUB inhdr
3442 $ i_inttypes = tmp
3443 $!
3444 $! Check to see if off64_t exists
3445 $!
3446 $ echo4 "Checking to see if you have off64_t..."
3447 $ OS
3448 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3449 $ WS "#include <stdlib.h>"
3450 $ WS "#endif"
3451 $ WS "#include <stdio.h>"
3452 $ WS "#include <types.h>"
3453 $ WS "#''i_inttypes' IIH"
3454 $ WS "#ifdef IIH"
3455 $ WS "#include <inttypes.h>"
3456 $ WS "#endif"
3457 $ WS "int main()"
3458 $ WS "{"
3459 $ WS "off64_t bar;"
3460 $ WS "exit(0);"
3461 $ WS "}"
3462 $ CS
3463 $ GOSUB compile_ok
3464 $ IF compile_status .EQ. good_compile
3465 $ THEN
3466 $   d_off64_t="define"
3467 $   echo "You have off64_t."
3468 $ ELSE
3469 $   d_off64_t = "undef"
3470 $   echo "You do not have off64_t."
3471 $ ENDIF
3472 $!
3473 $! Check to see if fpos64_t exists
3474 $!
3475 $ echo4 "Checking to see if you have fpos64_t..."
3476 $ OS
3477 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3478 $ WS "#include <stdlib.h>"
3479 $ WS "#endif"
3480 $ WS "#include <stdio.h>"
3481 $ WS "#include <types.h>"
3482 $ WS "#''i_inttypes' IIH"
3483 $ WS "#ifdef IIH"
3484 $ WS "#include <inttypes.h>"
3485 $ WS "#endif"
3486 $ WS "int main()"
3487 $ WS "{"
3488 $ WS "fpos64_t bar;"
3489 $ WS "exit(0);"
3490 $ WS "}"
3491 $ CS
3492 $ GOSUB compile_ok
3493 $ IF compile_status .EQ. good_compile
3494 $ THEN
3495 $   d_fpos64_t="define"
3496 $   echo "You have fpos64_t."
3497 $ ELSE
3498 $   d_fpos64_t = "undef"
3499 $   echo "You do not have fpos64_t."
3500 $ ENDIF
3501 $!
3502 $! Check to see if int64_t exists
3503 $!
3504 $ echo4 "Checking to see if you have int64_t..."
3505 $ OS
3506 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3507 $ WS "#include <stdlib.h>"
3508 $ WS "#endif"
3509 $ WS "#include <stdio.h>"
3510 $ WS "#include <types.h>"
3511 $ WS "#''i_inttypes' IIH"
3512 $ WS "#ifdef IIH"
3513 $ WS "#include <inttypes.h>"
3514 $ WS "#endif"
3515 $ WS "int main()"
3516 $ WS "{"
3517 $ WS "int64_t bar;"
3518 $ WS "exit(0);"
3519 $ WS "}"
3520 $ CS
3521 $ GOSUB compile_ok
3522 $ IF compile_status .EQ. good_compile
3523 $ THEN
3524 $   d_int64_t="define"
3525 $   echo "You have int64_t."
3526 $ ELSE
3527 $   d_int64_t = "undef"
3528 $   echo "You do not have int64_t."
3529 $ ENDIF
3530 $!
3531 $!: see if this is a netdb.h system
3532 $ IF Has_Dec_C_Sockets
3533 $ THEN 
3534 $   tmp = "netdb.h"
3535 $   GOSUB inhdr
3536 $   i_netdb = tmp
3537 $ ENDIF
3538 $!
3539 $! Check for h_errno
3540 $!
3541 $ echo4 "Checking to see if you have h_errno..."
3542 $ OS
3543 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3544 $ WS "#include <stdlib.h>"
3545 $ WS "#endif"
3546 $ WS "#include <stdio.h>"
3547 $ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3548 $ IF i_netdb  .EQS. "define" THEN WS "#include <netdb.h>"
3549 $ WS "int main()"
3550 $ WS "{"
3551 $ WS "h_errno = 3;"
3552 $ WS "exit(0);"
3553 $ WS "}"
3554 $ CS
3555 $ GOSUB link_ok
3556 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3557 $ THEN
3558 $   d_herrno="define"
3559 $   echo "You have h_errno."
3560 $ ELSE
3561 $   d_herrno="undef"
3562 $   echo "You do not have h_errno."
3563 $ ENDIF
3564 $!
3565 $! Check to see if gethostname exists
3566 $!
3567 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3568 $ THEN
3569 $   OS
3570 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3571 $   WS "#include <stdlib.h>"
3572 $   WS "#endif"
3573 $   WS "#include <stdio.h>"
3574 $   WS "#include <types.h>"
3575 $   IF Has_Socketshr
3576 $   THEN
3577 $     WS "#include <socketshr.h>"
3578 $   ELSE
3579 $     WS "#include <time.h>"
3580 $     WS "#include <socket.h>"
3581 $   ENDIF
3582 $   WS "int main()"
3583 $   WS "{"
3584 $   WS "char name[100];"
3585 $   WS "int bar, baz;"
3586 $   WS "bar = 100;"
3587 $   WS "baz = gethostname(name, bar);"
3588 $   WS "exit(0);"
3589 $   WS "}"
3590 $   CS
3591 $   GOSUB link_ok
3592 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3593 $   THEN
3594 $     d_gethname="define"
3595 $     echo4 "gethostname() found."
3596 $   ELSE
3597 $     d_gethname="undef"
3598 $   ENDIF
3599 $ ELSE
3600 $   ! No sockets, so no gethname
3601 $   d_gethname = "undef"
3602 $ ENDIF
3603 $!
3604 $! Check for sys/file.h
3605 $!
3606 $ tmp = "sys/file.h"
3607 $ GOSUB inhdr
3608 $ i_sysfile = tmp
3609 $!
3610 $! Check for sys/utsname.h
3611 $!
3612 $ tmp = "sys/utsname.h"
3613 $ GOSUB inhdr
3614 $ i_sysutsname = tmp
3615 $!
3616 $! Check for syslog.h
3617 $!
3618 $ tmp = "syslog.h"
3619 $ GOSUB inhdr
3620 $ i_syslog = tmp
3621 $!
3622 $! Check for poll.h
3623 $!
3624 $ tmp = "poll.h"
3625 $ GOSUB inhdr
3626 $ i_poll = tmp
3627 $!
3628 $! Check for sys/uio.h
3629 $!
3630 $ tmp = "sys/uio.h"
3631 $ GOSUB inhdr
3632 $ i_sysuio = tmp
3633 $!
3634 $! Check for sys/mode.h
3635 $!
3636 $ tmp = "sys/mode.h"
3637 $ GOSUB inhdr
3638 $ i_sysmode = tmp
3639 $!
3640 $! Check for sys/access.h
3641 $!
3642 $ tmp = "sys/access.h"
3643 $ GOSUB inhdr
3644 $ i_sysaccess = tmp
3645 $!
3646 $! Check for sys/security.h
3647 $!
3648 $ tmp = "sys/security.h"
3649 $ GOSUB inhdr
3650 $ i_syssecrt = tmp
3651 $!
3652 $! Check for fcntl.h
3653 $!
3654 $ tmp = "fcntl.h"
3655 $ GOSUB inhdr
3656 $ i_fcntl = tmp
3657 $!
3658 $! Check for fcntl
3659 $!
3660 $ OS
3661 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3662 $ WS "#include <stdlib.h>"
3663 $ WS "#endif"
3664 $ WS "#include <stdio.h>"
3665 $ WS "#include <fcntl.h>"
3666 $ WS "int main()"
3667 $ WS "{"
3668 $ WS "fcntl(1,2,3);"
3669 $ WS "exit(0);"
3670 $ WS "}"
3671 $ CS
3672 $ tmp = "fcntl"
3673 $ GOSUB inlibc
3674 $ d_fcntl = tmp
3675 $!
3676 $! Check for fcntl locking capability
3677 $!
3678 $ echo4 "Checking if fcntl-based file locking works... "
3679 $ tmp = "undef"
3680 $ IF d_fcntl .EQS. "define"
3681 $ THEN
3682 $   OS
3683 $   WS "#include <stdio.h>"
3684 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3685 $   WS "#include <stdlib.h>"
3686 $   WS "#endif"
3687 $   WS "#include <fcntl.h>"
3688 $   WS "#include <unistd.h>"
3689 $   WS "int main() {"
3690 $   WS "#if defined(F_SETLK) && defined(F_SETLKW)"
3691 $   WS "     struct flock flock;"
3692 $   WS "     int retval, fd;"
3693 $   WS "     fd = open(""try.c"", O_RDONLY);"
3694 $   WS "     flock.l_type = F_RDLCK;"
3695 $   WS "     flock.l_whence = SEEK_SET;"
3696 $   WS "     flock.l_start = flock.l_len = 0;"
3697 $   WS "     retval = fcntl(fd, F_SETLK, &flock);"
3698 $   WS "     close(fd);"
3699 $   WS "     (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
3700 $   WS "#else"
3701 $   WS "     printf(""undef\n"");"
3702 $   WS "#endif"
3703 $   WS "}"
3704 $   CS
3705 $   GOSUB link_ok
3706 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3707 $   THEN
3708 $     GOSUB just_mcr_it
3709 $     IF tmp .EQS. "define"
3710 $     THEN
3711 $       echo4 "Yes, it seems to work."
3712 $     ELSE
3713 $       echo4 "Nope, it didn't work."
3714 $     ENDIF
3715 $   ELSE
3716 $     echo4 "I'm unable to compile the test program, so I'll assume not."
3717 $     tmp = "undef"
3718 $   ENDIF
3719 $ ELSE
3720 $   echo4 "Nope, since you don't even have fcntl()."
3721 $ ENDIF
3722 $ d_fcntl_can_lock = tmp
3723 $!
3724 $! Check for memchr
3725 $!
3726 $ OS
3727 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3728 $ WS "#include <stdlib.h>"
3729 $ WS "#endif"
3730 $ WS "#include <string.h>"
3731 $ WS "int main()"
3732 $ WS "{"
3733 $ WS "char * place;"
3734 $ WS "place = memchr(""foo"", 47, 3);"
3735 $ WS "exit(0);"
3736 $ WS "}"
3737 $ CS
3738 $ tmp = "memchr"
3739 $ GOSUB inlibc
3740 $ d_memchr = tmp
3741 $!
3742 $! Check for strtoull
3743 $!
3744 $ OS
3745 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3746 $ WS "#include <stdlib.h>"
3747 $ WS "#endif"
3748 $ WS "#include <string.h>"
3749 $ WS "int main()"
3750 $ WS "{"
3751 $ WS "unsigned __int64 result;"
3752 $ WS "result = strtoull(""123123"", NULL, 10);"
3753 $ WS "exit(0);"
3754 $ WS "}"
3755 $ CS
3756 $ tmp = "strtoull"
3757 $ GOSUB inlibc
3758 $ d_strtoull = tmp
3759 $!
3760 $! Check for strtouq
3761 $!
3762 $ OS
3763 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3764 $ WS "#include <stdlib.h>"
3765 $ WS "#endif"
3766 $ WS "#include <string.h>"
3767 $ WS "int main()"
3768 $ WS "{"
3769 $ WS "unsigned __int64 result;"
3770 $ WS "result = strtouq(""123123"", NULL, 10);"
3771 $ WS "exit(0);"
3772 $ WS "}"
3773 $ CS
3774 $ tmp = "strtouq"
3775 $ GOSUB inlibc
3776 $ d_strtouq = tmp
3777 $!
3778 $! Check for strtoll
3779 $!
3780 $ OS
3781 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3782 $ WS "#include <stdlib.h>"
3783 $ WS "#endif"
3784 $ WS "#include <string.h>"
3785 $ WS "int main()"
3786 $ WS "{"
3787 $ WS "__int64 result;"
3788 $ WS "result = strtoll(""123123"", NULL, 10);"
3789 $ WS "exit(0);"
3790 $ WS "}"
3791 $ CS
3792 $ tmp = "strtoll"
3793 $ GOSUB inlibc
3794 $ d_strtoll = tmp
3795 $!
3796 $! Check for strtoq
3797 $!
3798 $ OS
3799 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3800 $ WS "#include <stdlib.h>"
3801 $ WS "#endif"
3802 $ WS "#include <string.h>"
3803 $ WS "int main()"
3804 $ WS "{"
3805 $ WS "__int64 result;"
3806 $ WS "result = strtoq(""123123"", NULL, 10);"
3807 $ WS "exit(0);"
3808 $ WS "}"
3809 $ CS
3810 $ tmp = "strtoq"
3811 $ GOSUB inlibc
3812 $ d_strtoq = tmp
3813 $!
3814 $! Check for strtoq
3815 $!
3816 $ OS
3817 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3818 $ WS "#include <stdlib.h>"
3819 $ WS "#endif"
3820 $ WS "#include <string.h>"
3821 $ WS "int main()"
3822 $ WS "{"
3823 $ WS "__int64 result;"
3824 $ WS "result = strtoq(""123123"", NULL, 10);"
3825 $ WS "exit(0);"
3826 $ WS "}"
3827 $ CS
3828 $ tmp = "strtoq"
3829 $ GOSUB inlibc
3830 $ d_strtoq = tmp
3831 $!
3832 $! Check for strtold
3833 $!
3834 $ OS
3835 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3836 $ WS "#include <stdlib.h>"
3837 $ WS "#endif"
3838 $ WS "#include <string.h>"
3839 $ WS "int main()"
3840 $ WS "{"
3841 $ WS "long double result;"
3842 $ WS "result = strtold(""123123"", NULL, 10);"
3843 $ WS "exit(0);"
3844 $ WS "}"
3845 $ CS
3846 $ tmp = "strtold"
3847 $ GOSUB inlibc
3848 $ d_strtold = tmp
3849 $!
3850 $! Check for atoll
3851 $!
3852 $ OS
3853 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3854 $ WS "#include <stdlib.h>"
3855 $ WS "#endif"
3856 $ WS "#include <string.h>"
3857 $ WS "int main()"
3858 $ WS "{"
3859 $ WS " __int64 result;"
3860 $ WS "result = atoll(""123123"");"
3861 $ WS "exit(0);"
3862 $ WS "}"
3863 $ CS
3864 $ tmp = "atoll"
3865 $ GOSUB inlibc
3866 $ d_atoll = tmp
3867 $!
3868 $! Check for atolf
3869 $!
3870 $ OS
3871 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3872 $ WS "#include <stdlib.h>"
3873 $ WS "#endif"
3874 $ WS "#include <string.h>"
3875 $ WS "int main()"
3876 $ WS "{"
3877 $ WS "long double"
3878 $ WS "result = atolf(""123123"");"
3879 $ WS "exit(0);"
3880 $ WS "}"
3881 $ CS
3882 $ tmp = "atolf"
3883 $ GOSUB inlibc
3884 $ d_atolf = tmp
3885 $!
3886 $! Check for access
3887 $!
3888 $ OS
3889 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3890 $ WS "#include <stdlib.h>"
3891 $ WS "#endif"
3892 $ WS "#include <stdio.h>"
3893 $ WS "int main()"
3894 $ WS "{"
3895 $ WS "access(""foo"", F_OK);"
3896 $ WS "exit(0);"
3897 $ WS "}"
3898 $ CS
3899 $ tmp = "acess"
3900 $ GOSUB inlibc
3901 $ d_access = tmp
3902 $!
3903 $! Check for bzero
3904 $!
3905 $ OS
3906 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3907 $ WS "#include <stdlib.h>"
3908 $ WS "#endif"
3909 $ WS "#include <stdio.h>"
3910 $ WS "#include <strings.h>"
3911 $ WS "int main()"
3912 $ WS "{"
3913 $ WS "char foo[10];"
3914 $ WS "bzero(foo, 10);"
3915 $ WS "exit(0);"
3916 $ WS "}"
3917 $ CS
3918 $ tmp = "bzero"
3919 $ GOSUB inlibc
3920 $ d_bzero = tmp
3921 $!
3922 $! Check for bcopy
3923 $!
3924 $ OS
3925 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3926 $ WS "#include <stdlib.h>"
3927 $ WS "#endif"
3928 $ WS "#include <stdio.h>"
3929 $ WS "#include <strings.h>"
3930 $ WS "int main()"
3931 $ WS "{"
3932 $ WS "char foo[10], bar[10];"
3933 $ WS "bcopy(""foo"", bar, 3);"
3934 $ WS "exit(0);"
3935 $ WS "}"
3936 $ CS
3937 $ tmp = "bcopy"
3938 $ GOSUB inlibc
3939 $ d_bcopy = tmp
3940 $!
3941 $! Check for mkstemp
3942 $!
3943 $ OS
3944 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3945 $ WS "#include <stdlib.h>"
3946 $ WS "#endif"
3947 $ WS "#include <stdio.h>"
3948 $ WS "int main()"
3949 $ WS "{"
3950 $ WS "mkstemp(""foo"");"
3951 $ WS "exit(0);"
3952 $ WS "}"
3953 $ CS
3954 $ tmp = "mkstemp"
3955 $ GOSUB inlibc
3956 $ d_mkstemp = tmp
3957 $!
3958 $! Check for mkstemps
3959 $!
3960 $ OS
3961 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3962 $ WS "#include <stdlib.h>"
3963 $ WS "#endif"
3964 $ WS "#include <stdio.h>"
3965 $ WS "int main()"
3966 $ WS "{"
3967 $ WS "mkstemps(""foo"", 1);"
3968 $ WS "exit(0);"
3969 $ WS "}"
3970 $ CS
3971 $ tmp = "mkstemps"
3972 $ GOSUB inlibc
3973 $ d_mkstemps = tmp
3974 $!
3975 $! Check for mkdtemp
3976 $!
3977 $ OS
3978 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3979 $ WS "#include <stdlib.h>"
3980 $ WS "#endif"
3981 $ WS "#include <stdio.h>"
3982 $ WS "int main()"
3983 $ WS "{"
3984 $ WS "mkdtemp(""foo"");"
3985 $ WS "exit(0);"
3986 $ WS "}"
3987 $ CS
3988 $ tmp = "mkdtemp"
3989 $ GOSUB inlibc
3990 $ d_mkdtemp = tmp
3991 $!
3992 $! Check for setvbuf
3993 $!
3994 $ OS
3995 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3996 $ WS "#include <stdlib.h>"
3997 $ WS "#endif"
3998 $ WS "#include <stdio.h>"
3999 $ WS "int main()"
4000 $ WS "{"
4001 $ WS "FILE *foo;"
4002 $ WS "char Buffer[99];"
4003 $ WS "foo = fopen(""foo"", ""r"");"
4004 $ WS "setvbuf(foo, Buffer, 0, 0);"
4005 $ WS "exit(0);"
4006 $ WS "}"
4007 $ CS
4008 $ tmp = "setvbuf"
4009 $ GOSUB inlibc
4010 $ d_setvbuf = tmp
4011 $!
4012 $! see if sfio.h is available
4013 $! see if sfio library is available
4014 $! Ok, but do we want to use it.
4015 $! IF F$TYPE(usesfio) .EQS. "" THEN usesfio = "undef"
4016 $! IF val .EQS. "define"
4017 $! THEN
4018 $!   IF usesfio .EQS. "define"
4019 $!   THEN dflt = "y"
4020 $!   ELSE dflt = "n"
4021 $!   ENDIF
4022 $!   echo "''package' can use the sfio library, but it is experimental."
4023 $!   IF useperlio .EQS. "undef"
4024 $!   THEN
4025 $!     echo "For sfio also the PerlIO abstraction layer is needed."
4026 $!     echo "Earlier you said you would not want that."
4027 $!   ENDIF
4028 $!   rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
4029 $!   GOSUB myread
4030 $!   IF ans .EQS. "" THEN ans = dflt
4031 $!   IF ans
4032 $!   THEN
4033 $!     echo "Ok, turning on both sfio and PerlIO, then."
4034 $!     useperlio="define"
4035 $!     val="define"
4036 $!   ELSE
4037 $!     echo "Ok, avoiding sfio this time.  I'll use stdio instead."
4038 $!     val="undef"
4039 $!   ENDIF
4040 $! ELSE
4041 $!   IF usesfio .EQS. "define"
4042 $!   THEN
4043 $!     echo4 "Sorry, cannot find sfio on this machine."
4044 $!     echo4 "Ignoring your setting of usesfio=''usesfio'."
4045 $!     val="undef"
4046 $!   ENDIF
4047 $! ENDIF
4048 $!
4049 $! Check for setenv
4050 $!
4051 $ OS
4052 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4053 $ WS "#include <stdlib.h>"
4054 $ WS "#endif"
4055 $ WS "#include <stdio.h>"
4056 $ WS "int main()"
4057 $ WS "{"
4058 $ WS "setenv(""FOO"", ""BAR"", 0);"
4059 $ WS "exit(0);"
4060 $ WS "}"
4061 $ CS
4062 $ tmp = "setenv"
4063 $ GOSUB inlibc
4064 $ d_setenv = tmp
4065 $!
4066 $! Check for setproctitle
4067 $!
4068 $ OS
4069 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4070 $ WS "#include <stdlib.h>"
4071 $ WS "#endif"
4072 $ WS "#include <stdio.h>"
4073 $ WS "int main()"
4074 $ WS "{"
4075 $ WS "setproctitle(""%s"", ""FOO"");"
4076 $ WS "exit(0);"
4077 $ WS "}"
4078 $ CS
4079 $ tmp = "setproctitle"
4080 $ GOSUB inlibc
4081 $ d_setproctitle = tmp
4082 $!
4083 $! Check for <netinet/in.h>
4084 $!
4085 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4086 $ THEN
4087 $   tmp = "netinet/in.h"
4088 $   GOSUB inhdr
4089 $   i_niin = tmp
4090 $ ELSE
4091 $   i_niin="undef"
4092 $ ENDIF
4093 $!
4094 $! Check for <netinet/tcp.h>
4095 $!
4096 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4097 $ THEN
4098 $   tmp = "netinet/tcp.h"
4099 $   GOSUB inhdr
4100 $   i_netinettcp = tmp
4101 $ ELSE
4102 $   i_netinettcp="undef"
4103 $ ENDIF
4104 $!
4105 $! Check for endhostent
4106 $!
4107 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4108 $ THEN
4109 $   OS
4110 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4111 $   WS "#include <stdlib.h>"
4112 $   WS "#endif"
4113 $   WS "#include <stdio.h>"
4114 $   IF Has_Socketshr
4115 $   THEN WS "#include <socketshr.h>"
4116 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4117 $   ENDIF
4118 $   WS "int main()"
4119 $   WS "{"
4120 $   WS "endhostent();"
4121 $   WS "exit(0);"
4122 $   WS "}"
4123 $   CS
4124 $   tmp = "endhostent"
4125 $   GOSUB inlibc
4126 $   d_endhent = tmp
4127 $ ELSE
4128 $   d_endhent="undef"
4129 $ ENDIF
4130 $!
4131 $! Check for endnetent
4132 $!
4133 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4134 $ THEN
4135 $   OS
4136 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4137 $   WS "#include <stdlib.h>"
4138 $   WS "#endif"
4139 $   WS "#include <stdio.h>"
4140 $   IF Has_Socketshr
4141 $   THEN WS "#include <socketshr.h>"
4142 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4143 $   ENDIF
4144 $   WS "int main()"
4145 $   WS "{"
4146 $   WS "endnetent();"
4147 $   WS "exit(0);"
4148 $   WS "}"
4149 $   CS
4150 $   tmp = "endnetent"
4151 $   GOSUB inlibc
4152 $   d_endnent = tmp
4153 $ ELSE
4154 $   d_endnent="undef"
4155 $ ENDIF
4156 $!
4157 $! Check for endprotoent
4158 $!
4159 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4160 $ THEN
4161 $   OS
4162 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4163 $   WS "#include <stdlib.h>"
4164 $   WS "#endif"
4165 $   WS "#include <stdio.h>"
4166 $   IF Has_Socketshr
4167 $   THEN WS "#include <socketshr.h>"
4168 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4169 $   ENDIF
4170 $   WS "int main()"
4171 $   WS "{"
4172 $   WS "endprotoent();"
4173 $   WS "exit(0);"
4174 $   WS "}"
4175 $   CS
4176 $   tmp = "endprotoent"
4177 $   GOSUB inlibc
4178 $   d_endpent = tmp
4179 $ ELSE
4180 $   d_endpent="undef"
4181 $ ENDIF
4182 $!
4183 $! Check for endservent
4184 $!
4185 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4186 $ THEN
4187 $   OS
4188 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4189 $   WS "#include <stdlib.h>"
4190 $   WS "#endif"
4191 $   WS "#include <stdio.h>"
4192 $   IF Has_Socketshr
4193 $   THEN WS "#include <socketshr.h>"
4194 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4195 $   ENDIF
4196 $   WS "int main()"
4197 $   WS "{"
4198 $   WS "endservent();"
4199 $   WS "exit(0);"
4200 $   WS "}"
4201 $   CS
4202 $   tmp = "endservent"
4203 $   GOSUB inlibc
4204 $   d_endsent = tmp
4205 $ ELSE
4206 $   d_endsent="undef"
4207 $ ENDIF
4208 $!
4209 $! Check for sethostent
4210 $!
4211 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4212 $ THEN
4213 $   OS
4214 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4215 $   WS "#include <stdlib.h>"
4216 $   WS "#endif"
4217 $   WS "#include <stdio.h>"
4218 $   IF Has_Socketshr
4219 $   THEN WS "#include <socketshr.h>"
4220 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4221 $   ENDIF
4222 $   WS "int main()"
4223 $   WS "{"
4224 $   WS "sethostent(1);"
4225 $   WS "exit(0);"
4226 $   WS "}"
4227 $   CS
4228 $   tmp = "sethostent"
4229 $   GOSUB inlibc
4230 $   d_sethent = tmp
4231 $ ELSE
4232 $   d_sethent="undef"
4233 $ ENDIF
4234 $!
4235 $! Check for setnetent
4236 $!
4237 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4238 $ THEN
4239 $   OS
4240 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4241 $   WS "#include <stdlib.h>"
4242 $   WS "#endif"
4243 $   WS "#include <stdio.h>"
4244 $   IF Has_Socketshr
4245 $   THEN WS "#include <socketshr.h>"
4246 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4247 $   ENDIF
4248 $   WS "int main()"
4249 $   WS "{"
4250 $   WS "setnetent(1);"
4251 $   WS "exit(0);"
4252 $   WS "}"
4253 $   CS
4254 $   tmp = "setnetent"
4255 $   GOSUB inlibc
4256 $   d_setnent = tmp
4257 $ ELSE
4258 $   d_setnent="undef"
4259 $ ENDIF
4260 $!
4261 $! Check for setprotoent
4262 $!
4263 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4264 $ THEN
4265 $   OS
4266 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4267 $   WS "#include <stdlib.h>"
4268 $   WS "#endif"
4269 $   WS "#include <stdio.h>"
4270 $   IF Has_Socketshr
4271 $   THEN WS "#include <socketshr.h>"
4272 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4273 $   ENDIF
4274 $   WS "int main()"
4275 $   WS "{"
4276 $   WS "setprotoent(1);"
4277 $   WS "exit(0);"
4278 $   WS "}"
4279 $   CS
4280 $   tmp = "setprotoent"
4281 $   GOSUB inlibc
4282 $   d_setpent = tmp
4283 $ ELSE
4284 $   d_setpent="undef"
4285 $ ENDIF
4286 $!
4287 $! Check for setservent
4288 $!
4289 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4290 $ THEN
4291 $   OS
4292 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4293 $   WS "#include <stdlib.h>"
4294 $   WS "#endif"
4295 $   WS "#include <stdio.h>"
4296 $   IF Has_Socketshr
4297 $   THEN WS "#include <socketshr.h>"
4298 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4299 $   ENDIF
4300 $   WS "int main()"
4301 $   WS "{"
4302 $   WS "setservent(1);"
4303 $   WS "exit(0);"
4304 $   WS "}"
4305 $   CS
4306 $   tmp = "setservent"
4307 $   GOSUB inlibc
4308 $   d_setsent = tmp
4309 $ ELSE
4310 $   d_setsent="undef"
4311 $ ENDIF
4312 $!
4313 $! Check for gethostent
4314 $!
4315 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4316 $ THEN
4317 $   OS
4318 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4319 $   WS "#include <stdlib.h>"
4320 $   WS "#endif"
4321 $   WS "#include <stdio.h>"
4322 $   IF Has_Socketshr
4323 $   THEN WS "#include <socketshr.h>"
4324 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4325 $   ENDIF
4326 $   WS "int main()"
4327 $   WS "{"
4328 $   WS "gethostent();"
4329 $   WS "exit(0);"
4330 $   WS "}"
4331 $   CS
4332 $   tmp = "gethostent"
4333 $   GOSUB inlibc
4334 $   d_gethent = tmp
4335 $ ELSE
4336 $   d_gethent="undef"
4337 $ ENDIF
4338 $!
4339 $! Check for getnetent
4340 $!
4341 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4342 $ THEN
4343 $   OS
4344 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4345 $   WS "#include <stdlib.h>"
4346 $   WS "#endif"
4347 $   WS "#include <stdio.h>"
4348 $   IF Has_Socketshr
4349 $   THEN WS "#include <socketshr.h>"
4350 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4351 $   ENDIF
4352 $   WS "int main()"
4353 $   WS "{"
4354 $   WS "getnetent();"
4355 $   WS "exit(0);"
4356 $   WS "}"
4357 $   CS
4358 $   tmp = "getnetent"
4359 $   GOSUB inlibc
4360 $   d_getnent = tmp
4361 $ ELSE
4362 $   d_getnent="undef"
4363 $ ENDIF
4364 $!
4365 $! Check for getprotoent
4366 $!
4367 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4368 $ THEN
4369 $   OS
4370 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4371 $   WS "#include <stdlib.h>"
4372 $   WS "#endif"
4373 $   WS "#include <stdio.h>"
4374 $   IF Has_Socketshr
4375 $   THEN WS "#include <socketshr.h>"
4376 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4377 $   ENDIF
4378 $   WS "int main()"
4379 $   WS "{"
4380 $   WS "getprotoent();"
4381 $   WS "exit(0);"
4382 $   WS "}"
4383 $   CS
4384 $   tmp = "getprotoent"
4385 $   GOSUB inlibc
4386 $   d_getpent = tmp
4387 $ ELSE
4388 $   d_getpent="undef"
4389 $ ENDIF
4390 $!
4391 $! Check for getservent
4392 $!
4393 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4394 $ THEN
4395 $   OS
4396 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4397 $   WS "#include <stdlib.h>"
4398 $   WS "#endif"
4399 $   WS "#include <stdio.h>"
4400 $   IF Has_Socketshr
4401 $   THEN WS "#include <socketshr.h>"
4402 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4403 $   ENDIF
4404 $   WS "int main()"
4405 $   WS "{"
4406 $   WS "getservent();"
4407 $   WS "exit(0);"
4408 $   WS "}"
4409 $   CS
4410 $   tmp = "getservent"
4411 $   GOSUB inlibc
4412 $   d_getsent = tmp
4413 $ ELSE
4414 $   d_getsent="undef"
4415 $ ENDIF
4416 $!
4417 $! Check for socklen_t
4418 $!
4419 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4420 $ THEN
4421 $   echo4 "Checking to see if you have socklen_t..."
4422 $   OS
4423 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4424 $   WS "#include <stdlib.h>"
4425 $   WS "#endif"
4426 $   WS "#include <stdio.h>"
4427 $   IF Has_Socketshr
4428 $   THEN WS "#include <socketshr.h>"
4429 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4430 $   ENDIF
4431 $   WS "int main()"
4432 $   WS "{"
4433 $   WS "socklen_t x = 16;"
4434 $   WS "exit(0);"
4435 $   WS "}"
4436 $   CS
4437 $   GOSUB link_ok
4438 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4439 $   THEN
4440 $     d_socklen_t="define"
4441 $     echo "You have socklen_t."
4442 $   ELSE
4443 $     d_socklen_t="undef"
4444 $     echo "You do not have socklen_t."
4445 $   ENDIF
4446 $ ELSE
4447 $   d_socklen_t="undef"
4448 $ ENDIF
4449 $!
4450 $! Check for pthread_yield
4451 $!
4452 $ IF use_threads
4453 $ THEN
4454 $   OS
4455 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4456 $   WS "#include <stdlib.h>"
4457 $   WS "#endif"
4458 $   WS "#include <pthread.h>"
4459 $   WS "#include <stdio.h>"
4460 $   WS "int main()"
4461 $   WS "{"
4462 $   WS "pthread_yield();"
4463 $   WS "exit(0);"
4464 $   WS "}"
4465 $   CS
4466 $   tmp = "pthread_yield"
4467 $   GOSUB inlibc
4468 $   d_pthread_yield = tmp
4469 $ ELSE
4470 $   d_pthread_yield="undef"
4471 $ ENDIF
4472 $!
4473 $! Check for sched_yield
4474 $!
4475 $ IF use_threads
4476 $ THEN
4477 $   OS
4478 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4479 $   WS "#include <stdlib.h>"
4480 $   WS "#endif"
4481 $   WS "#include <pthread.h>"
4482 $   WS "#include <stdio.h>"
4483 $   WS "int main()"
4484 $   WS "{"
4485 $   WS "sched_yield();"
4486 $   WS "exit(0);"
4487 $   WS "}"
4488 $   CS
4489 $   tmp = "sched_yield"
4490 $   GOSUB inlibc
4491 $   d_sched_yield = tmp
4492 $   IF d_sched_yield .EQS. "define"
4493 $   THEN sched_yield = "sched_yield"
4494 $   ELSE sched_yield = " "
4495 $   ENDIF
4496 $ ELSE
4497 $   d_sched_yield="undef"
4498 $   sched_yield = " "
4499 $ ENDIF
4500 $!
4501 $! Check for generic pointer size
4502 $!
4503 $ echo4 "Checking to see how big your pointers are..." 
4504 $ OS
4505 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4506 $ WS "#include <stdlib.h>"
4507 $ WS "#endif"
4508 $ WS "#include <stdio.h>"
4509 $ WS "int main()"
4510 $ WS "{"
4511 $ WS "int foo;"
4512 $ WS "foo = sizeof(char *);"
4513 $ WS "printf(""%d\n"", foo);"
4514 $ WS "exit(0);"
4515 $ WS "}"
4516 $ CS
4517 $ tmp = "char *"
4518 $ GOSUB type_size_check
4519 $ ptrsize = tmp
4520 $ echo "Your pointers are ''ptrsize' bytes long."
4521 $!
4522 $! Check for size_t size
4523 $!
4524 $ tmp = "size_t"
4525 $ zzz = tmp
4526 $ echo4 "Checking the size of ''zzz'..."
4527 $ GOSUB type_size_check
4528 $ sizesize = tmp
4529 $ echo "Your ''zzz' size is ''sizesize' bytes."
4530 $!
4531 $! Check rand48 and its ilk
4532 $!
4533 $ echo4 "Looking for a random number function..."
4534 $ OS
4535 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4536 $ WS "#include <stdlib.h>"
4537 $ WS "#endif"
4538 $ WS "#include <stdio.h>"
4539 $ WS "int main()"
4540 $ WS "{"
4541 $ WS "srand48(12L);"
4542 $ WS "exit(0);"
4543 $ WS "}"
4544 $ CS
4545 $ GOSUB link_ok
4546 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4547 $ THEN
4548 $   drand01 = "drand48()"
4549 $   randseedtype = "long int"
4550 $   seedfunc = "srand48"
4551 $   echo4 "Good, found drand48()."
4552 $   d_drand48proto = "define"
4553 $ ELSE
4554 $   d_drand48proto = "undef"
4555 $   drand01="random()"
4556 $   randseedtype = "unsigned"
4557 $   seedfunc = "srandom"
4558 $   OS
4559 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4560 $   WS "#include <stdlib.h>"
4561 $   WS "#endif"
4562 $   WS "#include <stdio.h>"
4563 $   WS "int main()"
4564 $   WS "{"
4565 $   WS "srandom(12);"
4566 $   WS "exit(0);"
4567 $   WS "}"
4568 $   CS
4569 $   GOSUB link_ok
4570 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4571 $   THEN
4572 $     echo4 "OK, found random()."
4573 $   ELSE
4574 $     drand01="(((float)rand())*MY_INV_RAND_MAX)"
4575 $     randseedtype = "unsigned"
4576 $     seedfunc = "srand"
4577 $     echo4 "Yick, looks like I have to use rand()."
4578 $   ENDIF
4579 $ ENDIF
4580 $! Done with compiler checks. Clean up.
4581 $ IF F$SEARCH("try.c")  .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
4582 $ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
4583 $ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
4584 $ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
4585 $ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
4586 $ IF ccname .EQS. "CXX"
4587 $ THEN
4588 $   CALL Cxx_demangler_cleanup
4589 $ ENDIF
4590 $!
4591 $! Some that are compiler or VMS version sensitive
4592 $!
4593 $! Gnu C stuff
4594 $ IF ccname .EQS. "GCC"
4595 $ THEN
4596 $   d_attribut="define"
4597 $   vms_cc_type="gcc"
4598 $ ELSE
4599 $   vms_cc_type="cc"
4600 $   d_attribut="undef"
4601 $ ENDIF
4602 $!
4603 $! Dec C >= 5.2 and VMS ver >= 7.0
4604 $ IF (ccname .EQS. "DEC") .AND. -
4605      (F$INTEGER(Dec_C_Version).GE.50200000) .AND. (vms_ver .GES. "7.0")
4606 $ THEN
4607 $   d_bcmp="define"
4608 $   d_getitimer="define"
4609 $   d_gettimeod="define"
4610 $   d_mmap="define"
4611 $   d_mprotect="define"
4612 $   d_munmap="define"
4613 $   d_msync="define"
4614 $   d_ualarm="define"
4615 $   d_uname="define"
4616 $   d_usleep="define"
4617 $   d_setitimer="define"
4618 $   d_sigaction="define"
4619 $   d_sigprocmask="define"
4620 $   d_truncate="define"
4621 $   d_wait4="define"
4622 $   d_index="define"
4623 $   pidtype="pid_t"
4624 $   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2 SPARE18 SPARE19 CHLD CONT STOP TSTP TTIN TTOU DEBUG SPARE27 SPARE28 SPARE29 SPARE30 SPARE31 SPARE32 RTMIN RTMAX"",0"
4625 $   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4626 $   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",""SPARE18"",""SPARE19"",""CHLD"",""CONT"",""STOP"",""TSTP"","
4627 $   psnwc3="""TTIN"",""TTOU"",""DEBUG"",""SPARE27"",""SPARE28"",""SPARE29"",""SPARE30"",""SPARE31"",""SPARE32"",""RTMIN"",""RTMAX"",0"
4628 $   sig_name_init = psnwc1 + psnwc2 + psnwc3
4629 $   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 64"",0"
4630 $   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,64,0"
4631 $!   perl_sig_num_with_commas=sig_num_init
4632 $   sig_size="36"
4633 $   uidtype="uid_t"
4634 $   d_pathconf="define"
4635 $   d_fpathconf="define"
4636 $   d_sysconf="define"
4637 $   d_sigsetjmp="define"
4638 $ ELSE
4639 $   pidtype="unsigned int"
4640 $   d_bcmp="undef"
4641 $   d_getitimer="undef"
4642 $   d_gettimeod="undef"
4643 $   d_mmap="undef"
4644 $   d_mprotect="undef"
4645 $   d_munmap="undef"
4646 $   d_msync="undef"
4647 $   d_ualarm="undef"
4648 $   d_uname="undef"
4649 $   d_usleep="undef"
4650 $   d_setitimer="undef"
4651 $   d_sigaction="undef"
4652 $   d_sigprocmask="undef"
4653 $   d_truncate="undef"
4654 $   d_wait4="undef"
4655 $   d_index="undef"
4656 $   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4657 $   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4658 $   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4659 $   sig_name_init = psnwc1 + psnwc2
4660 $   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"",0"
4661 $   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
4662 $!   perl_sig_num_with_commas=sig_num_init
4663 $   sig_size="19"
4664 $   uidtype="unsigned int"
4665 $   d_pathconf="undef"
4666 $   d_fpathconf="undef"
4667 $   d_sysconf="undef"
4668 $   d_sigsetjmp="undef"
4669 $ ENDIF
4670 $!: see if tzname[] exists
4671 $ OS
4672 $ WS "#include <stdio.h>"
4673 $ WS "#include <time.h>"
4674 $ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
4675 $ CS
4676 $ GOSUB compile_ok
4677 $ IF compile_status .EQ. good_compile
4678 $ THEN
4679 $   d_tzname = "undef"
4680 $   echo4 "tzname[] NOT found."
4681 $ ELSE
4682 $   d_tzname = "define"
4683 $   echo4 "tzname[] found."
4684 $ ENDIF
4685 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
4686 $!
4687 $ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
4688 $ THEN
4689 $   d_phostname="define"
4690 $ ELSE
4691 $   d_phostname="undef"
4692 $ ENDIF
4693 $!
4694 $! Dec C alone
4695 $ IF ccname .EQS. "DEC"
4696 $ THEN
4697 $   d_mbstowcs="define"
4698 $   d_mbtowc="define"
4699 $   d_stdiobase="define"
4700 $   d_stdio_cnt_lval="define"
4701 $   d_stdio_ptr_lval="define"
4702 $   d_stdstdio="define"
4703 $   d_wcstombs="define"
4704 $   d_mblen="define"
4705 $   d_mktime="define"
4706 $   d_strcoll="define"
4707 $   d_strxfrm="define"
4708 $   d_wctomb="define"
4709 $   i_locale="define"
4710 $   i_langinfo="define"
4711 $   d_locconv="define"
4712 $   d_nl_langinfo="define"
4713 $   d_setlocale="define"
4714 $   vms_cc_type="decc"
4715 $ ELSE
4716 $   d_mbstowcs="undef"
4717 $   d_mbtowc="undef"
4718 $   d_stdiobase="undef"
4719 $   d_stdio_cnt_lval="undef"
4720 $   d_stdio_ptr_lval="undef"
4721 $   d_stdstdio="undef"
4722 $   d_wcstombs="undef"
4723 $   d_mblen="undef"
4724 $   d_mktime="undef"
4725 $   d_strcoll="undef"
4726 $   d_strxfrm="undef"
4727 $   d_wctomb="undef"
4728 $   i_locale="undef"
4729 $   i_langinfo="undef"
4730 $   d_locconv="undef"
4731 $   d_nl_langinfo="undef"
4732 $   d_setlocale="undef"
4733 $ ENDIF
4734 $ d_stdio_ptr_lval_sets_cnt="undef"
4735 $ d_stdio_ptr_lval_nochange_cnt="define"
4736 $!
4737 $! Sockets?
4738 $ if Has_Socketshr .OR. Has_Dec_C_Sockets
4739 $ THEN
4740 $   d_vms_do_sockets="define"
4741 $   d_htonl="define"
4742 $   d_socket="define"
4743 $   d_select="define"
4744 $   netdb_hlen_type="int"
4745 $   netdb_host_type="char *"
4746 $   netdb_name_type="char *"
4747 $   netdb_net_type="long"
4748 $   d_gethbyaddr="define"
4749 $   d_gethbyname="define"
4750 $   d_getnbyaddr="define"
4751 $   d_getnbyname="define"
4752 $   d_getpbynumber="define"
4753 $   d_getpbyname="define"
4754 $   d_getsbyport="define"
4755 $   d_getsbyname="define"
4756 $   d_gethostprotos="define"
4757 $   d_getnetprotos="define"
4758 $   d_getprotoprotos="define"
4759 $   d_getservprotos="define"
4760 $   IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
4761 $   THEN
4762 $     socksizetype="unsigned int"
4763 $   ELSE
4764 $     socksizetype="int *"
4765 $   ENDIF
4766 $ ELSE
4767 $   d_vms_do_sockets="undef"
4768 $   d_htonl="undef"
4769 $   d_socket="undef"
4770 $   d_select="undef"
4771 $   netdb_hlen_type="int"
4772 $   netdb_host_type="char *"
4773 $   netdb_name_type="char *"
4774 $   netdb_net_type="long"
4775 $   d_gethbyaddr="undef"
4776 $   d_gethbyname="undef"
4777 $   d_getnbyaddr="undef"
4778 $   d_getnbyname="undef"
4779 $   d_getpbynumber="undef"
4780 $   d_getpbyname="undef"
4781 $   d_getsbyport="undef"
4782 $   d_getsbyname="undef"
4783 $   d_gethostprotos="undef"
4784 $   d_getnetprotos="undef"
4785 $   d_getprotoprotos="undef"
4786 $   d_getservprotos="undef"
4787 $   socksizetype="undef"
4788 $ ENDIF
4789 $! Threads
4790 $ IF use_threads
4791 $ THEN
4792 $   usethreads="define"
4793 $   d_pthreads_created_joinable="define"
4794 $   if (vms_ver .GES. "7.0")
4795 $   THEN
4796 $     d_oldpthreads="undef"
4797 $   ELSE
4798 $     d_oldpthreads="define"
4799 $   ENDIF
4800 $ ELSE
4801 $   d_oldpthreads="undef"
4802 $   usethreads="undef"
4803 $   d_pthreads_created_joinable="undef"
4804 $ ENDIF
4805 $! 
4806 $! new (5.005_62++) typedefs for primitives
4807 $!
4808 $ echo "Choosing the C types to be used for Perl's internal types..."
4809 $ ivtype="long"
4810 $ uvtype="unsigned long"
4811 $ i8type="char"
4812 $ u8type="unsigned char"
4813 $ i16type="short"
4814 $ u16type="unsigned short"
4815 $ i32type="int"
4816 $ u32type="unsigned int"
4817 $ i64type="long long"
4818 $ u64type="unsigned long long"
4819 $ nvtype="double"
4820 $!
4821 $ IF use64bitint .OR. use64bitint .EQS. "define"
4822 $ THEN
4823 $   ivtype = "''i64type'"
4824 $   uvtype = "''u64type'"
4825 $   nvtype="long double"
4826 $ ELSE
4827 $   i64size="undef"
4828 $   u64size="undef"
4829 $ ENDIF
4830 $!
4831 $ tmp = "''ivtype'"
4832 $ GOSUB type_size_check
4833 $ ivsize = tmp
4834 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
4835 $ IF ivtype .eqs. "long"
4836 $ THEN longsize = tmp
4837 $ ELSE
4838 $   tmp = "long"
4839 $   GOSUB type_size_check
4840 $   longsize = tmp
4841 $ ENDIF
4842 $!
4843 $ tmp = "''uvtype'"
4844 $ GOSUB type_size_check
4845 $ uvsize = tmp
4846 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
4847 $!
4848 $ tmp = "''i8type'"
4849 $ GOSUB type_size_check
4850 $ i8size = tmp
4851 $!
4852 $ tmp = "''u8type'"
4853 $ GOSUB type_size_check
4854 $ u8size = tmp
4855 $!
4856 $ tmp = "''i16type'"
4857 $ GOSUB type_size_check
4858 $ i16size = tmp
4859 $ IF i16type .eqs. "short"
4860 $ THEN shortsize = tmp
4861 $ ELSE
4862 $   tmp = "short"
4863 $   gosub type_size_check
4864 $   shortsize = tmp
4865 $ ENDIF
4866 $!
4867 $ tmp = "''u16type'"
4868 $ GOSUB type_size_check
4869 $ u16size = tmp
4870 $!
4871 $ tmp = "''i32type'"
4872 $ GOSUB type_size_check
4873 $ i32size = tmp
4874 $ IF i32type .eqs. "int"
4875 $ THEN intsize = tmp
4876 $ ELSE
4877 $   tmp = "int"
4878 $   gosub type_size_check
4879 $   intsize = tmp
4880 $ ENDIF
4881 $!
4882 $ tmp = "''u32type'"
4883 $ gosub type_size_check
4884 $ u32size = tmp
4885 $!
4886 $ tmp = "''nvtype'"
4887 $ GOSUB type_size_check
4888 $ nvsize = tmp
4889 $!
4890 $ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
4891 $ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
4892 $ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
4893 $!
4894 $ echo4 "Checking whether your NVs can preserve your UVs..."
4895 $ OS
4896 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4897 $ WS "#include <stdlib.h>"
4898 $ WS "#endif"
4899 $ WS "#include <stdio.h>"
4900 $ WS "int main() {"
4901 $ WS "    ''uvtype' k = (''uvtype')~0, l;"
4902 $ WS "    ''nvtype' d;"
4903 $ WS "    l = k;"
4904 $ WS "    d = (''nvtype')l;"
4905 $ WS "    l = (''uvtype')d;"
4906 $ WS "    if (l == k)"
4907 $ WS "       printf(""preserve\n"");"
4908 $ WS "    exit(0);"
4909 $ WS "}"
4910 $ CS
4911 $ GOSUB compile
4912 $ IF tmp .EQS. "preserve"
4913 $ THEN 
4914 $   d_nv_preserves_uv = "define"
4915 $   echo "Yes, they can." 
4916 $   d_nv_preserves_uv_bits = F$STRING(F$INTEGER(uvsize) * 8)
4917 $ ELSE
4918 $   d_nv_preserves_uv = "undef"
4919 $   echo "No, they can't."
4920 $   echo4 "Checking how many bits of your UVs your NVs can preserve..."
4921 $   OS
4922 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4923 $   WS "#include <stdlib.h>"
4924 $   WS "#endif"
4925 $   WS "#include <stdio.h>"
4926 $   WS "int main() {"
4927 $   WS "    ''uvtype' u = 0;"
4928 $   WS "    int     n = 8 * ''uvsize';"
4929 $   WS "    int     i;"
4930 $   WS "    for (i = 0; i < n; i++) {"
4931 $   WS "      u = u << 1 | (''uvtype')1;"
4932 $   WS "      if ((''uvtype')(''nvtype')u != u)"
4933 $   WS "        break;"
4934 $   WS "    }"
4935 $   WS "    printf(""%d\n"", i);"
4936 $   WS "    exit(0);"
4937 $   WS "}"
4938 $   CS
4939 $   GOSUB compile
4940 $   d_nv_preserves_uv_bits = tmp
4941 $ ENDIF
4942 $!
4943 $ echo4 "Checking whether your kill() uses SYS$FORCEX..."
4944 $ kill_by_sigprc = "undef"
4945 $ OS
4946 $ WS "#include <stdio.h>"
4947 $ WS "#include <signal.h>"
4948 $ WS "void handler(int s) { printf(""%d\n"",s); } "
4949 $ WS "main(){"
4950 $ WS "    printf(""0"");"
4951 $ WS "    signal(1,handler); kill(0,1);"
4952 $ WS "}"
4953 $ CS
4954 $ ON ERROR THEN CONTINUE
4955 $ GOSUB compile
4956 $ IF tmp .NES. "01"
4957 $ THEN 
4958 $   echo "Yes, it does." 
4959 $   echo4 "Checking whether we can use SYS$SIGPRC instead"
4960 $   OS
4961 $   WS "#include <stdio.h>"
4962 $   WS "#include <lib$routines.h>"
4963 $   WS "unsigned long code = 0;"
4964 $   WS "int handler(unsigned long *args) {"
4965 $   WS "    code = args[1];"
4966 $   WS "    return 1;"
4967 $   WS "}"
4968 $   WS "main() { "
4969 $   WS "    int iss, sys$sigprc();"
4970 $   WS "    lib$establish(handler);"
4971 $   WS "    iss = sys$sigprc(0,0,0x1234);"
4972 $   WS "    iss =  ((iss&1)==1 && code == 0x1234);" 
4973 $   WS "    printf(""%d\n"",iss);"
4974 $   WS "}"
4975 $   CS
4976 $   GOSUB compile
4977 $   IF tmp .EQS. "1"
4978 $   THEN
4979 $       echo "looks like we can"
4980 $       kill_by_sigprc = "define"
4981 $!
4982 $!      since SIGBUS and SIGSEGV indistinguishable, make them the same here.
4983 $!      sigusr1 and sigusr2 show up in VMS6.2 and later
4984 $!
4985 $       if  vms_ver .GES. "6.2"
4986 $       then
4987 $           sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4988 $           psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4989 $           psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4990 $           sig_name_init = psnwc1 + psnwc2
4991 $           sig_num="0 1 2 3 4 5 6 7 8 9 10 10 12 13 14 15 6 16 17"",0"
4992 $           sig_num_init="0,1,2,3,4,5,6,7,8,9,10,10,12,13,14,15,6,16,17,0"
4993 $           sig_size="19"
4994 $       else
4995 $           sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT"",0"
4996 $           psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4997 $           psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",0"
4998 $           sig_name_init = psnwc1 + psnwc2
4999 $           sig_num="0 1 2 3 4 5 6 7 8 9 10 10 12 13 14 15 6"",0"
5000 $           sig_num_init="0,1,2,3,4,5,6,7,8,9,10,10,12,13,14,15,6,0"
5001 $           sig_size="17"
5002 $       endif
5003 $   ENDIF
5004 $ ENDIF
5005 $ DELETE/SYMBOL tmp
5006 $!
5007 $! Finally the composite ones. All config
5008 $!
5009 $ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
5010 $!
5011 $ IF ccname .EQS. "DEC"
5012 $ THEN
5013 $   ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5014 $ ENDIF
5015 $ i_dirent = "undef"
5016 $ IF ccname .EQS. "CXX"
5017 $ THEN
5018 $   i_dirent = "define"
5019 $   ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5020 $ ENDIF
5021 $ IF use_vmsdebug_perl
5022 $ THEN
5023 $   optimize="/List/Debug/NoOpt"
5024 $   ldflags="/Debug/Trace/Map"
5025 $   dbgprefix = "DBG"
5026 $ ELSE
5027 $   optimize= "/NoList"
5028 $   ldflags="/NoTrace/NoMap"
5029 $   dbgprefix = ""
5030 $ ENDIF
5031 $!
5032 $! Okay, we've got everything configured. Now go write out a config.sh.
5033 $ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
5034 $ echo4 "Creating ''basename_config_sh'..."
5035 $ open/write CONFIG 'config_sh'
5036 $ WC := write CONFIG
5037 $!
5038 $! ##BEGIN WRITE NEW CONSTANTS HERE##
5039 $!
5040 $ WC "#!/bin/sh"
5041 $ WC "#"
5042 $ WC "# This file was produced by Configure.COM on a ''osname' system."
5043 $ WC "#"
5044 $ WC "# Package name      : ''package'"
5045 $ WC "# Source directory  : ''src'"
5046 $ WC "# Configuration time: " + cf_time
5047 $ WC "# Configuration by  : " + cf_by
5048 $ WC "# Target system     : " + myuname
5049 $ WC ""
5050 $ WC "CONFIG='true'"
5051 $ WC "Makefile_SH='" + Makefile_SH + "'"
5052 $ WC "Mcc='" + Mcc + "'"
5053 $ WC "PERL_REVISION='" + revision + "'"
5054 $ WC "PERL_VERSION='" + patchlevel + "'" 
5055 $ WC "PERL_SUBVERSION='" + subversion + "'" 
5056 $ WC "PERL_API_VERSION='" + api_version + "'" 
5057 $ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
5058 $ WC "alignbytes='" + alignbytes + "'"
5059 $ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
5060 $ WC "ar='" + "'"
5061 $ WC "archlib='" + archlib + "'"
5062 $ WC "archlibexp='" + archlibexp + "'"
5063 $ WC "archname='" + archname + "'"
5064 $ WC "baserev='" + baserev + "'"
5065 $ WC "bin='" + bin + "'"
5066 $ WC "binexp='" + binexp + "'"
5067 $ WC "builddir='" + builddir + "'"
5068 $ WC "byteorder='1234'"
5069 $ WC "castflags='0'"
5070 $ WC "cc='" + perl_cc + "'"
5071 $ WC "cccdlflags='" + cccdlflags + "'"
5072 $ WC "ccdlflags='" + ccdlflags + "'"
5073 $ WC "ccflags='" + ccflags + "'"
5074 $ WC "ccname='" + ccname + "'"
5075 $ WC "ccversion='" + ccversion + "'"
5076 $ WC "cf_by='" + cf_by + "'"
5077 $ WC "cf_email='" + cf_email + "'"
5078 $ WC "cf_time='" + cf_time + "'"
5079 $ WC "config_args='" + config_args + "'"
5080 $ WC "config_sh='" + config_sh + "'"
5081 $ WC "cpp_stuff='" + cpp_stuff + "'"
5082 $ WC "cpplast='" + cpplast + "'"
5083 $ WC "cppminus='" + cppminus + "'"
5084 $ WC "cpprun='" + cpprun + "'"
5085 $ WC "cppstdin='" + cppstdin + "'"
5086 $ IF use64bitint .OR. use64bitint .EQS. "define"
5087 $ THEN
5088 $!  gcvt() does not work for > 16 decimal places; fallback to sprintf
5089 $   WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
5090 $ ELSE
5091 $   WC "d_Gconvert='my_gconvert(x,n,t,b)'"
5092 $ ENDIF
5093 $ WC "d_PRIEldbl='" + d_PRIEUldbl + "'"
5094 $ WC "d_PRIFldbl='" + d_PRIFUldbl + "'"
5095 $ WC "d_PRIGldbl='" + d_PRIGUldbl + "'"
5096 $ WC "d_PRIXU64='" + d_PRIXU64 + "'"
5097 $ WC "d_PRId64='" + d_PRId64 + "'"
5098 $ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
5099 $ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
5100 $ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
5101 $ WC "d_PRIo64='" + d_PRIo64 + "'"
5102 $ WC "d_PRIu64='" + d_PRIu64 + "'"
5103 $ WC "d_PRIx64='" + d_PRIx64 + "'"
5104 $ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
5105 $ WC "d__fwalk='undef'"
5106 $ WC "d_access='" + d_access + "'"
5107 $ WC "d_accessx='undef'"
5108 $ WC "d_alarm='define'"
5109 $ WC "d_archlib='define'"
5110 $ WC "d_atolf='" + d_atolf + "'"
5111 $ WC "d_atoll='" + d_atoll + "'"
5112 $ WC "d_attribut='" + d_attribut + "'"
5113 $ WC "d_bcmp='" + d_bcmp + "'"
5114 $ WC "d_bcopy='" + d_bcopy + "'"
5115 $ WC "d_bincompat3='undef'"
5116 $ WC "d_bincompat5005='undef'"
5117 $! WC "d_bsdpgrp='undef'"
5118 $ WC "d_bsdgetpgrp='undef'"
5119 $ WC "d_bsdsetpgrp='undef'"
5120 $ WC "d_bzero='" + d_bzero + "'"
5121 $ WC "d_casti32='define'"
5122 $ WC "d_castneg='define'"
5123 $ WC "d_charvspr='undef'"
5124 $ WC "d_chown='define'"
5125 $ WC "d_chroot='undef'"
5126 $ WC "d_chsize='undef'"
5127 $ WC "d_class='undef'"
5128 $ WC "d_cmsghdr_s='undef'"
5129 $ WC "d_const='define'"
5130 $ WC "d_crypt='define'"
5131 $ WC "d_csh='undef'"
5132 $ WC "d_cuserid='define'"
5133 $ WC "d_dbl_dig='define'"
5134 $ WC "d_dbminitproto='undef'"
5135 $ WC "d_difftime='define'"
5136 $ WC "d_dirfd='undef'"
5137 $ WC "d_dirnamlen='define'"
5138 $ WC "d_dlerror='undef'"
5139 $ WC "d_dlsymun='undef'"
5140 $ WC "d_dosuid='undef'"
5141 $ WC "d_drand48proto='" + d_drand48proto + "'"
5142 $ WC "d_dup2='define'"
5143 $ WC "d_eaccess='undef'"
5144 $ WC "d_endgrent='define'"
5145 $ WC "d_endhent='" + d_endhent + "'"
5146 $ WC "d_endnent='" + d_endnent + "'"
5147 $ WC "d_endpent='" + d_endpent + "'"
5148 $ WC "d_endpwent='define'"
5149 $ WC "d_endsent='" + d_endsent + "'"
5150 $ WC "d_eofnblk='undef'"
5151 $ WC "d_eunice='undef'"
5152 $ WC "d_fchmod='undef'"
5153 $ WC "d_fchdir='undef'"
5154 $ WC "d_fchown='undef'"
5155 $ WC "d_fcntl='" + d_fcntl + "'"
5156 $ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
5157 $ WC "d_fd_set='" + d_fd_set + "'"
5158 $ WC "d_fgetpos='define'"
5159 $ WC "d_finite='undef'"
5160 $ WC "d_finitel='undef'"
5161 $ WC "d_flexfnam='define'"
5162 $ WC "d_flock='undef'"
5163 $ WC "d_flockproto='undef'"
5164 $ WC "d_fork='undef'"
5165 $ WC "d_fp_class='undef'"
5166 $ WC "d_fpathconf='" + d_fpathconf + "'"
5167 $ WC "d_fpclass='undef'"
5168 $ WC "d_fpclassify='undef'"
5169 $ WC "d_fpclassl='undef'"
5170 $ WC "d_fpos64_t='" + d_fpos64_t + "'"
5171 $ WC "d_frexpl='" + d_frexpl + "'"
5172 $ WC "d_fs_data_s='undef'"
5173 $ WC "d_fseeko='undef'"
5174 $ WC "d_fsetpos='define'"
5175 $ WC "d_fstatfs='undef'"
5176 $ WC "d_fstatvfs='undef'"
5177 $ WC "d_fsync='undef'"
5178 $ WC "d_ftello='undef'"
5179 $ WC "d_getcwd='define'"
5180 $ WC "d_getespwnam='undef'"
5181 $ WC "d_getfsstat='undef'"
5182 $ WC "d_getgrent='define'"
5183 $ WC "d_getgrps='undef'"
5184 $ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
5185 $ WC "d_gethbyname='" + d_gethbyname + "'"
5186 $ WC "d_gethent='" + d_gethent + "'"
5187 $ WC "d_gethname='" + d_gethname + "'"
5188 $ WC "d_gethostprotos='" + d_gethostprotos + "'"
5189 $ WC "d_getitimer='" + d_getitimer + "'"
5190 $ WC "d_getlogin='define'"
5191 $ WC "d_getmnt='undef'"
5192 $ WC "d_getmntent='undef'"
5193 $ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
5194 $ WC "d_getnbyname='" + d_getnbyname + "'"
5195 $ WC "d_getnent='" + d_getnent + "'"
5196 $ WC "d_getnetprotos='" + d_getnetprotos + "'"
5197 $ WC "d_getpagsz='undef'"
5198 $ WC "d_getpbyname='" + d_getpbyname + "'"
5199 $ WC "d_getpbynumber='" + d_getpbynumber + "'"
5200 $ WC "d_getpent='" + d_getpent + "'"
5201 $ WC "d_getpgid='undef'"
5202 $ WC "d_getpgrp2='undef'"
5203 $ WC "d_getpgrp='undef'"
5204 $ WC "d_getppid='undef'"
5205 $ WC "d_getprior='undef'"
5206 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
5207 $ WC "d_getprpwnam='undef'"
5208 $ WC "d_getpwent='define'"
5209 $ WC "d_getsbyname='" + d_getsbyname + "'"
5210 $ WC "d_getsbyport='" + d_getsbyport + "'"
5211 $ WC "d_getsent='" + d_getsent + "'"
5212 $ WC "d_getservprotos='" + d_getservprotos + "'"
5213 $ WC "d_getspnam='undef'"
5214 $ WC "d_gettimeod='" + d_gettimeod + "'"
5215 $ WC "d_gnulibc='undef'"
5216 $ WC "d_grpasswd='undef'"
5217 $ WC "d_hasmntopt='undef'"
5218 $ WC "d_htonl='" + d_htonl + "'"
5219 $ WC "d_index='" + d_index + "'"
5220 $ WC "d_inetaton='undef'"
5221 $ WC "d_int64_t='" + d_int64_t + "'"
5222 $ WC "d_isascii='define'"
5223 $ WC "d_isfinite='undef'"
5224 $ WC "d_isinf='undef'"
5225 $ WC "d_isnan='" + d_isnan + "'"
5226 $ WC "d_isnanl='" + d_isnanl + "'"
5227 $ WC "d_killpg='undef'"
5228 $ WC "d_lchown='undef'"
5229 $ WC "d_ldbl_dig='define'"
5230 $ WC "d_link='undef'"
5231 $ WC "d_llseek='undef'"
5232 $ WC "d_locconv='" + d_locconv + "'"
5233 $ WC "d_lockf='undef'"
5234 $ WC "d_longdbl='" + d_longdbl + "'"
5235 $ WC "d_longlong='" + d_longlong + "'"
5236 $ WC "d_lseekproto='define'"
5237 $ WC "d_lstat='undef'"
5238 $ WC "d_madvise='undef'"
5239 $ WC "d_mblen='" + d_mblen + "'"
5240 $ WC "d_mbstowcs='" + d_mbstowcs + "'"
5241 $ WC "d_mbtowc='" + d_mbtowc + "'"
5242 $ WC "d_memchr='" + d_memchr + "'"
5243 $ WC "d_memcmp='define'"
5244 $ WC "d_memcpy='define'"
5245 $ WC "d_memmove='define'"
5246 $ WC "d_memset='define'"
5247 $ WC "d_mkdir='define'"
5248 $ WC "d_mkdtemp='" + d_mkdtemp + "'"
5249 $ WC "d_mkfifo='undef'"
5250 $ WC "d_mknod='undef'"
5251 $ WC "d_mkstemp='" + d_mkstemp + "'"
5252 $ WC "d_mkstemps='" + d_mkstemps + "'"
5253 $ WC "d_mktime='" + d_mktime + "'"
5254 $ WC "d_mmap='" + d_mmap + "'"
5255 $ WC "d_modfl='" + d_modfl + "'"
5256 $ WC "d_modfl_pow32_bug='undef'"
5257 $ WC "d_mprotect='" + d_mprotect + "'"
5258 $ WC "d_msg='undef'"
5259 $ WC "d_msg_ctrunc='undef'"
5260 $ WC "d_msg_dontroute='undef'"
5261 $ WC "d_msg_oob='undef'"
5262 $ WC "d_msg_peek='undef'"
5263 $ WC "d_msg_proxy='undef'"
5264 $ WC "d_msghdr_s='undef'"
5265 $ WC "d_msync='" + d_msync + "'"
5266 $ WC "d_munmap='" + d_munmap + "'"
5267 $ WC "d_mymalloc='" + d_mymalloc + "'"
5268 $ WC "d_nice='define'"
5269 $ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
5270 $ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
5271 $ WC "d_nv_preserves_uv_bits='" + d_nv_preserves_uv_bits + "'"
5272 $ WC "d_off64_t='" + d_off64_t + "'"
5273 $ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
5274 $ WC "d_oldarchlib='define'"
5275 $ WC "d_oldpthreads='" + d_oldpthreads + "'"
5276 $ WC "d_open3='define'"
5277 $ WC "d_pathconf='" + d_pathconf + "'"
5278 $ WC "d_pause='define'"
5279 $ WC "d_perl_otherlibdirs='undef'"
5280 $ WC "d_phostname='" + d_phostname + "'"
5281 $ WC "d_pipe='define'"
5282 $ WC "d_poll='undef'"
5283 $ WC "d_procselfexe='undef'"
5284 $ WC "d_pthread_atfork='undef'"
5285 $ WC "d_pthread_yield='" + d_pthread_yield + "'"
5286 $ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
5287 $ WC "d_pwage='undef'"
5288 $ WC "d_pwchange='undef'"
5289 $ WC "d_pwclass='undef'"
5290 $ WC "d_pwcomment='define'"
5291 $ WC "d_pwexpire='undef'"
5292 $ WC "d_pwgecos='define'"
5293 $ WC "d_pwpasswd='define'"
5294 $ WC "d_pwquota='undef'"
5295 $ WC "d_qgcvt='undef'"
5296 $ WC "d_quad='" + d_quad + "'"
5297 $ WC "d_readdir='define'"
5298 $ WC "d_readlink='undef'"
5299 $ WC "d_readv='undef'"
5300 $ WC "d_realpath='undef'"
5301 $ WC "d_recvmsg='undef'"
5302 $ WC "d_rename='define'"
5303 $ WC "d_rewinddir='define'"
5304 $ WC "d_rmdir='define'"
5305 $ WC "d_safebcpy='undef'"
5306 $ WC "d_safemcpy='define'"
5307 $ WC "d_sanemcmp='define'"
5308 $ WC "d_sbrkproto='define'"
5309 $ WC "d_sched_yield='" + d_sched_yield + "'"
5310 $ WC "d_scm_rights='undef'"
5311 $ WC "d_seekdir='define'"
5312 $ WC "d_select='" + d_select + "'"
5313 $ WC "d_sem='undef'"
5314 $ WC "d_semctl_semid_ds='undef'"
5315 $ WC "d_semctl_semun='undef'"
5316 $ WC "d_sendmsg='undef'"
5317 $ WC "d_setegid='undef'"
5318 $ WC "d_setenv='" + d_setenv + "'"
5319 $ WC "d_seteuid='undef'"
5320 $ WC "d_setgrent='undef'"
5321 $ WC "d_setgrps='undef'"
5322 $ WC "d_sethent='" + d_sethent + "'"
5323 $ WC "d_setitimer='" + d_setitimer + "'"
5324 $ WC "d_setlinebuf='undef'"
5325 $ WC "d_setlocale='" + d_setlocale + "'"
5326 $ WC "d_setnent='" + d_setnent + "'"
5327 $ WC "d_setpent='" + d_setpent + "'"
5328 $ WC "d_setpgid='undef'"
5329 $ WC "d_setpgrp2='undef'"
5330 $ WC "d_setpgrp='undef'"
5331 $ WC "d_setprior='undef'"
5332 $ WC "d_setproctitle='" + d_setproctitle + "'"
5333 $ WC "d_setpwent='define'"
5334 $ WC "d_setregid='undef'"
5335 $ WC "d_setresgid='undef'"
5336 $ WC "d_setresuid='undef'"
5337 $ WC "d_setreuid='undef'"
5338 $ WC "d_setrgid='undef'"
5339 $ WC "d_setruid='undef'"
5340 $ WC "d_setsent='" + d_setsent + "'"
5341 $ WC "d_setsid='undef'"
5342 $ WC "d_setvbuf='" + d_setvbuf + "'"
5343 $ WC "d_sfio='undef'"
5344 $ WC "d_shm='undef'"
5345 $ WC "d_shmatprototype='undef'"
5346 $ WC "d_sigaction='" + d_sigaction + "'"
5347 $ WC "d_sigprocmask='" + d_sigprocmask + "'"
5348 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
5349 $ WC "d_sockatmark='undef'"
5350 $ WC "d_sockatmarkproto='undef'"
5351 $ WC "d_socket='" + d_socket + "'"
5352 $ WC "d_socklen_t='" + d_socklen_t + "'"
5353 $ WC "d_sockpair='undef'"
5354 $ WC "d_socks5_init='undef'"
5355 $ WC "d_sqrtl='define'"
5356 $ WC "d_sresgproto='undef'"
5357 $ WC "d_sresgproto='undef'"
5358 $ WC "d_sresproto='undef'"
5359 $ WC "d_sresuproto='undef'"
5360 $ WC "d_statblks='undef'"
5361 $ WC "d_statfs_f_flags='undef'"
5362 $ WC "d_statfs_s='undef'"
5363 $ WC "d_statfsflags='undef'"
5364 $ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
5365 $ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
5366 $ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'"
5367 $ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'"
5368 $ WC "d_stdio_stream_array='undef'"
5369 $ WC "d_stdiobase='" + d_stdiobase + "'"
5370 $ WC "d_stdstdio='" + d_stdstdio + "'"
5371 $ WC "d_strchr='define'"
5372 $ WC "d_strcoll='" + d_strcoll + "'"
5373 $ WC "d_strctcpy='define'"
5374 $ WC "d_strerrm='strerror((e),vaxc$errno)'"
5375 $ WC "d_strerror='define'"
5376 $ WC "d_strftime='define'"
5377 $ WC "d_strtod='define'"
5378 $ WC "d_strtol='define'"
5379 $ WC "d_strtold='" + d_strtold + "'"
5380 $ WC "d_strtoll='" + d_strtoll + "'"
5381 $ WC "d_strtoq='define'"
5382 $ WC "d_strtoul='define'"
5383 $ WC "d_strtoull='" + d_strtoull + "'"
5384 $ WC "d_strtouq='" + d_strtouq + "'"
5385 $ WC "d_strxfrm='" + d_strxfrm  + "'"
5386 $ WC "d_suidsafe='undef'"
5387 $ WC "d_symlink='undef'"
5388 $ WC "d_syscall='undef'"
5389 $ WC "d_syscallproto='undef'"
5390 $ WC "d_sysconf='" + d_sysconf + "'"
5391 $ WC "d_syserrlst='undef'"
5392 $ WC "d_system='define'"
5393 $ WC "d_tcgetpgrp='undef'"
5394 $ WC "d_tcsetpgrp='undef'"
5395 $ WC "d_telldir='define'"
5396 $ WC "d_telldirproto='define'"
5397 $ WC "d_times='define'"
5398 $ WC "d_truncate='" + d_truncate + "'"
5399 $ WC "d_tzname='" + d_tzname + "'"
5400 $ WC "d_u32align='define'"
5401 $ WC "d_ualarm='" + d_ualarm + "'"
5402 $ WC "d_umask='define'"
5403 $ WC "d_uname='" + d_uname + "'"
5404 $ WC "d_union_semun='undef'"
5405 $ WC "d_unlink_all_versions='undef'"
5406 $ WC "d_unordered='undef'"
5407 $ WC "d_usleep='" + d_usleep + "'"
5408 $ WC "d_usleepproto='" + d_usleep + "'"
5409 $ WC "d_ustat='undef'"
5410 $ WC "d_vendorarch='undef'"
5411 $ WC "d_vendorlib='undef'"
5412 $ WC "d_vfork='define'"
5413 $ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
5414 $ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
5415 $ WC "d_void_closedir='define'"
5416 $ WC "d_volatile='define'"
5417 $ WC "d_vprintf='define'"
5418 $ WC "d_wait4='" + d_wait4 + "'"
5419 $ WC "d_waitpid='define'"
5420 $ WC "d_wcstombs='" + d_wcstombs + "'"
5421 $ WC "d_wctomb='" + d_wctomb + "'"
5422 $ WC "d_writev='undef'"
5423 $ WC "db_hashtype=' '"
5424 $ WC "db_prefixtype=' '"
5425 $ WC "dbgprefix='" + dbgprefix + "'"
5426 $ WC "defvoidused='15'"
5427 $ WC "devtype='" + devtype + "'"
5428 $ WC "direntrytype='struct dirent'"
5429 $ WC "dlext='" + dlext + "'"
5430 $ WC "dlobj='" + dlobj + "'"
5431 $ WC "dlsrc='dl_vms.c'"
5432 $ WC "doublesize='" + doublesize + "'"
5433 $ WC "drand01='" + drand01 + "'"
5434 $!
5435 $! The extensions symbol may be quite long
5436 $!
5437 $ tmp = "dynamic_ext='" + extensions + "'"
5438 $ WC/symbol tmp
5439 $ DELETE/SYMBOL tmp
5440 $ WC "eagain=' '"
5441 $ WC "ebcdic='undef'"
5442 $ WC "embedmymalloc='" + usemymalloc + "'"
5443 $ WC "eunicefix=':'"
5444 $ WC "exe_ext='" + exe_ext + "'"
5445 $!
5446 $! The extensions symbol may be quite long
5447 $!
5448 $ tmp = "extensions='" + extensions + "'"
5449 $ WC/symbol tmp
5450 $ DELETE/SYMBOL tmp
5451 $ WC "fflushNULL='define'"
5452 $ WC "fflushall='undef'"
5453 $ WC "fpostype='fpos_t'"
5454 $ WC "freetype='void'"
5455 $ WC "full_ar='" + "'"
5456 $ WC "full_csh='" + " '"
5457 $ WC "full_sed='_NLA0:'"
5458 $ WC "gccversion='" + gccversion + "'"
5459 $ WC "gidformat='lu'"
5460 $ WC "gidsign='1'"
5461 $ WC "gidsize='4'"
5462 $ WC "gidtype='" + gidtype + "'"
5463 $ WC "groupstype='Gid_t'"
5464 $ WC "hint='none'"
5465 $ WC "hintfile='" + "'"
5466 $ WC "i16size='" + i16size + "'"
5467 $ WC "i16type='" + i16type + "'"
5468 $ WC "i32size='" + i32size + "'"
5469 $ WC "i32type='" + i32type + "'"
5470 $ WC "i64size='" + i64size + "'"
5471 $ WC "i64type='" + i64type + "'"
5472 $ WC "i8size='" + i8size + "'"
5473 $ WC "i8type='" + i8type + "'"
5474 $ WC "i_arpainet='undef'"
5475 $ WC "i_dbm='undef'"
5476 $ WC "i_dirent='" + i_dirent + "'"
5477 $ WC "i_dlfcn='undef'"
5478 $ WC "i_fcntl='" + i_fcntl + "'"
5479 $ WC "i_float='define'"
5480 $ WC "i_fp='undef'"
5481 $ WC "i_fp_class='undef'"
5482 $ WC "i_grp='undef'"
5483 $ WC "i_ieeefp='undef'"
5484 $ WC "i_inttypes='" + i_inttypes + "'"
5485 $ WC "i_langinfo='" + i_langinfo + "'"
5486 $ WC "i_libutil='" + i_libutil + "'"
5487 $ WC "i_limits='define'"
5488 $ WC "i_locale='" + i_locale + "'"
5489 $ WC "i_machcthr='undef'"
5490 $ WC "i_machcthreads='undef'"
5491 $ WC "i_math='define'"
5492 $ WC "i_memory='undef'"
5493 $ WC "i_mntent='undef'"
5494 $ WC "i_ndbm='undef'"
5495 $ WC "i_netdb='" + i_netdb + "'"
5496 $ WC "i_neterrno='define'"
5497 $ WC "i_netinettcp='" + i_netinettcp + "'"
5498 $ WC "i_niin='" + i_niin + "'"
5499 $ WC "i_poll='" + i_poll + "'"
5500 $ WC "i_prot='undef'"
5501 $ WC "i_pthread='define'"
5502 $ WC "i_pwd='undef'"
5503 $ WC "i_rpcsvcdbm='undef'"
5504 $ WC "i_sfio='undef'"
5505 $ WC "i_sgtty='undef'"
5506 $ WC "i_shadow='" + i_shadow + "'"
5507 $ WC "i_socks='" + i_socks + "'"
5508 $ WC "i_stdarg='define'"
5509 $ WC "i_stddef='define'"
5510 $ WC "i_stdlib='define'"
5511 $ WC "i_string='define'"
5512 $ WC "i_sunmath='undef'"
5513 $ WC "i_sysaccess='" + i_sysaccess + "'"
5514 $ WC "i_sysdir='undef'"
5515 $ WC "i_sysfile='" + i_sysfile + "'"
5516 $ WC "i_sysioctl='undef'"
5517 $ WC "i_syslog='" + i_syslog + "'"
5518 $ WC "i_sysmman='undef'"
5519 $ WC "i_sysmode='" + i_sysmode + "'"
5520 $ WC "i_sysmount='undef'"
5521 $ WC "i_sysndir='undef'"
5522 $ WC "i_sysparam='undef'"
5523 $ WC "i_sysresrc='undef'"
5524 $ WC "i_syssecrt='" + i_syssecrt + "'"
5525 $ WC "i_sysselct='undef'"
5526 $ WC "i_syssockio='undef'"
5527 $ WC "i_sysstat='define'"
5528 $ WC "i_sysstatfs='undef'"
5529 $ WC "i_sysstatvfs='undef'"
5530 $ WC "i_systime='undef'"
5531 $ WC "i_systimek='undef'"
5532 $ WC "i_systimes='undef'"
5533 $ WC "i_systypes='define'"
5534 $ WC "i_sysuio='" + i_sysuio + "'"
5535 $ WC "i_sysun='undef'"
5536 $ WC "i_sysutsname='" + i_sysutsname + "'"
5537 $ WC "i_sysvfs='undef'"
5538 $ WC "i_syswait='undef'"
5539 $ WC "i_termio='undef'"
5540 $ WC "i_termios='undef'"
5541 $ WC "i_time='define'"
5542 $ WC "i_unistd='" + i_unistd + "'"
5543 $ WC "i_ustat='undef'"
5544 $ WC "i_utime='undef'"
5545 $ WC "i_values='undef'"
5546 $ WC "i_varargs='undef'"
5547 $ WC "i_vfork='undef'"
5548 $ WC "inc_version_list='0'"
5549 $ WC "inc_version_list_init='0'"
5550 $ WC "installarchlib='" + installarchlib + "'"
5551 $ WC "installbin='" + installbin + "'"
5552 $ WC "installman1dir='" + installman1dir + "'"
5553 $ WC "installman3dir='" + installman3dir + "'"
5554 $ WC "installprivlib='" + installprivlib + "'"
5555 $ WC "installscript='" + installscript + "'"
5556 $ WC "installsitearch='" + installsitearch + "'"
5557 $ WC "installsitelib='" + installsitelib + "'"
5558 $ WC "installusrbinperl='undef'"
5559 $ WC "intsize='" + intsize + "'"
5560 $ WC "ivdformat='" + ivdformat + "'"
5561 $ WC "ivsize='" + ivsize + "'"
5562 $ WC "ivtype='" + ivtype + "'"
5563 $!
5564 $! The known_extensions symbol may be quite long
5565 $!
5566 $ tmp = "known_extensions='" + known_extensions + "'"
5567 $ WC/symbol tmp
5568 $ DELETE/SYMBOL tmp
5569 $ WC "ld='" + ld + "'"
5570 $ WC "lddlflags='/Share'"
5571 $ WC "ldflags='" + ldflags + "'"
5572 $ WC "lib_ext='" + lib_ext + "'"
5573 $ WC "libc='" + libc + "'"
5574 $ WC "libpth='/sys$share /sys$library'"
5575 $ WC "libs='" + libs + "'"
5576 $ WC "longdblsize='" + longdblsize + "'"
5577 $ WC "longlongsize='" + longlongsize + "'"
5578 $ WC "longsize='" + longsize + "'"
5579 $ WC "lseeksize='4'"
5580 $ WC "lseektype='int'"
5581 $ WC "mab='" + "'"
5582 $ WC "make='" + make + "'"
5583 $ WC "malloctype='void *'"
5584 $ WC "man1ext='rno'"
5585 $ WC "man3ext='rno'"
5586 $ WC "mmaptype='void *'"
5587 $ WC "modetype='unsigned int'"
5588 $ WC "multiarch='undef'"
5589 $ WC "mydomain='" + mydomain + "'"
5590 $ WC "myhostname='" + myhostname + "'"
5591 $ WC "myuname='" + myuname + "'"
5592 $ WC "need_va_copy='undef'"
5593 $ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
5594 $ WC "netdb_host_type='" + netdb_host_type + "'"
5595 $ WC "netdb_name_type='" + netdb_name_type + "'"
5596 $ WC "netdb_net_type='" + netdb_net_type + "'"
5597 $ WC "nveformat='" + nveformat + "'"
5598 $ WC "nvfformat='" + nvfformat + "'"
5599 $ WC "nvgformat='" + nvgformat + "'"
5600 $ WC "nvsize='" + nvsize + "'"
5601 $ WC "nvtype='" + nvtype + "'"
5602 $ WC "o_nonblock=' '"
5603 $ WC "obj_ext='" + obj_ext + "'"
5604 $ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
5605 $ WC "oldarchlib='" + oldarchlib + "'"
5606 $ WC "oldarchlibexp='" + oldarchlibexp + "'"
5607 $ WC "optimize='" + optimize + "'"
5608 $ WC "osname='" + osname + "'"
5609 $ WC "osvers='" + osvers + "'"
5610 $ WC "otherlibdirs='" + "'"
5611 $ WC "package='" + package + "'"
5612 $ WC "pager='" + pager + "'"
5613 $ WC "patchlevel='" + patchlevel + "'"
5614 $ WC "path_sep='|'"
5615 $ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
5616 $ WC "perladmin='" + perladmin + "'"
5617 $ WC "perllibs='" + perllibs + "'"
5618 $ WC "perl_symbol='" + perl_symbol + "'"  ! VMS specific
5619 $ WC "perl_verb='" + perl_verb + "'"      ! VMS specific
5620 $ WC "pgflquota='" + pgflquota + "'"
5621 $ WC "pidtype='" + pidtype + "'"
5622 $ WC "pm_apiversion='" + version + "'"
5623 $! WC "prefix='" + vms_prefix + "'"
5624 $ WC "prefix='" + prefix + "'"
5625 $ WC "privlib='" + privlib + "'"
5626 $ WC "privlibexp='" + privlibexp + "'"
5627 $ WC "procselfexe=' '"
5628 $ WC "prototype='define'"
5629 $ WC "ptrsize='" + ptrsize + "'"
5630 $ WC "quadkind='" + quadkind + "'"
5631 $ WC "quadtype='" + quadtype + "'" 
5632 $ WC "randbits='31'"
5633 $ WC "randseedtype='" + randseedtype + "'"
5634 $ WC "ranlib='" + "'"
5635 $ WC "rd_nodata=' '"
5636 $ WC "revision='" + revision + "'"
5637 $ WC "sPRId64='" + sPRId64 + "'"
5638 $ WC "sPRIEldbl='" + sPRIEUldbl + "'"
5639 $ WC "sPRIFldbl='" + sPRIFUldbl + "'"
5640 $ WC "sPRIGldbl='" + sPRIGUldbl + "'"
5641 $ WC "sPRIX64='" + sPRIXU64 + "'"
5642 $ WC "sPRIeldbl='" + sPRIeldbl + "'"
5643 $ WC "sPRIfldbl='" + sPRIfldbl + "'"
5644 $ WC "sPRIgldbl='" + sPRIgldbl + "'"
5645 $! WC "sPRIi64='" + sPRIi64 + "'"
5646 $ WC "sPRIo64='" + sPRIo64 + "'"
5647 $ WC "sPRIu64='" + sPRIu64 + "'"
5648 $ WC "sPRIx64='" + sPRIx64 + "'"
5649 $ WC "sSCNfldbl='" + sSCNfldbl + "'"
5650 $ WC "sched_yield='" + sched_yield + "'"
5651 $ WC "scriptdir='" + scriptdir + "'"
5652 $ WC "scriptdirexp='" + scriptdir + "'"  ! use scriptdir for now
5653 $ WC "seedfunc='" + seedfunc + "'"
5654 $ WC "selectminbits='32'"
5655 $ WC "selecttype='" + selecttype + "'"
5656 $ WC "sh='MCR'"
5657 $ WC "shmattype='" + " '"
5658 $ WC "shortsize='" + shortsize + "'"
5659 $ WC "shrplib='define'"
5660 $ WC "sig_name='" + sig_name + "'"
5661 $ tmp = "sig_name_init='" + sig_name_init + "'"
5662 $ WC/symbol tmp
5663 $ DELETE/SYMBOL tmp
5664 $ WC "sig_num='" + sig_num + "'"
5665 $ WC "sig_num_init='" + sig_num_init + "'"
5666 $ WC "sig_size='" + sig_size + "'"
5667 $ WC "signal_t='" + signal_t + "'"
5668 $ WC "sitearch='" + sitearch + "'"
5669 $ WC "sitearchexp='" + sitearchexp + "'"
5670 $ WC "sitelib='" + sitelib + "'"
5671 $ WC "sitelib_stem='" + sitelib_stem + "'"
5672 $ WC "sitelibexp='" + sitelibexp + "'"
5673 $ WC "sizesize='" + sizesize + "'"
5674 $ WC "sizetype='size_t'"
5675 $ WC "so='" + so + "'"
5676 $ WC "socksizetype='" + socksizetype + "'"
5677 $ WC "spitshell='write sys$output '"
5678 $ WC "src='" + src + "'"
5679 $ WC "ssizetype='int'"
5680 $ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
5681 $ WC "static_ext='" + static_ext + "'"
5682 $ WC "stdchar='" + stdchar + "'"
5683 $ WC "stdio_base='((*fp)->_base)'"
5684 $ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
5685 $ WC "stdio_cnt='((*fp)->_cnt)'"
5686 $ WC "stdio_ptr='((*fp)->_ptr)'"
5687 $ WC "stdio_stream_array=' " + "'"
5688 $ WC "subversion='" + subversion + "'"
5689 $ WC "timetype='" + timetype + "'"
5690 $ WC "u16size='" + u16size + "'"
5691 $ WC "u16type='" + u16type + "'"
5692 $ WC "u32size='" + u32size + "'"
5693 $ WC "u32type='" + u32type + "'"
5694 $ WC "u64size='" + u64size + "'"
5695 $ WC "u64type='" + u64type + "'"
5696 $ WC "u8size='" + u8size + "'"
5697 $ WC "u8type='" + u8type + "'"
5698 $ WC "uidformat='lu'"
5699 $ WC "uidsign='1'"
5700 $ WC "uidsize='4'"
5701 $ WC "uidtype='" + uidtype + "'"
5702 $ WC "uquadtype='" + uquadtype + "'" 
5703 $ WC "use5005threads='" + use5005threads + "'"
5704 $ WC "use64bitall='" + use64bitall + "'"
5705 $ WC "use64bitint='" + use64bitint + "'"
5706 $ WC "usecasesensitive='" + be_case_sensitive + "'"    ! VMS-specific
5707 $ WC "usedebugging_perl='"+use_debugging_perl+"'"
5708 $ WC "usedefaulttypes='" + usedefaulttypes + "'"    ! VMS-specific
5709 $ WC "usecrosscompile='undef'"
5710 $ WC "usedl='" + usedl + "'"
5711 $ WC "useieee='" + useieee + "'"                    ! VMS-specific
5712 $ WC "useithreads='" + useithreads + "'"
5713 $ WC "uselargefiles='" + uselargefiles + "'"
5714 $ WC "uselongdouble='" + uselongdouble + "'"
5715 $ WC "usemorebits='" + usemorebits + "'"
5716 $ WC "usemultiplicity='" + usemultiplicity + "'"
5717 $ WC "usemymalloc='" + usemymalloc + "'"
5718 $ WC "useperlio='" + useperlio + "'"
5719 $ WC "useposix='false'"
5720 $ WC "usereentrant='undef'"
5721 $ WC "usesecurelog='" + usesecurelog + "'"  ! VMS-specific
5722 $ WC "usesocks='undef'"
5723 $ WC "usethreads='" + usethreads + "'"
5724 $ WC "usevfork='true'"
5725 $ WC "usevmsdebug='" + usevmsdebug + "'"     ! VMS-specific
5726 $ WC "uvoformat='" + uvoformat + "'"
5727 $ WC "uvsize='" + uvsize + "'"
5728 $ WC "uvtype='" + uvtype + "'"
5729 $ WC "uvuformat='" + uvuformat + "'"
5730 $ WC "uvxformat='" + uvxformat + "'"
5731 $ WC "uvXUformat='" + uvXUformat + "'"
5732 $ WC "vendorarchexp='" + "'"
5733 $ WC "vendorlib_stem='" + "'"
5734 $ WC "vendorlibexp='" + "'"
5735 $ WC "version='" + version + "'"
5736 $ WC "version_patchlevel_string='" + version_patchlevel_string + "'"
5737 $ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
5738 $ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
5739 $ WC "vms_ver='" + vms_ver + "'" ! VMS specific
5740 $ WC "voidflags='15'"
5741 $ WC "xs_apiversion='" + version + "'"
5742 $ WC "PERL_CONFIG_SH='true'"
5743 $!
5744 $! ##END WRITE NEW CONSTANTS HERE##
5745 $!
5746 $ CLOSE CONFIG
5747 $!
5748 $! Okay, we've gotten here. Build munchconfig.exe
5749 $ COPY/NOLOG [-.vms]munchconfig.c []
5750 $ COPY/NOLOG [-.vms]'Makefile_SH' []
5751 $ 'Perl_CC' munchconfig.c
5752 $ IF Needs_Opt
5753 $ THEN
5754 $   OPEN/WRITE CONFIG []munchconfig.opt
5755 $   IF ccname .EQS. "GCC"
5756 $   THEN
5757 $     WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
5758 $   ENDIF
5759 $   WRITE CONFIG "Sys$Share:VAXCRTL/Share"
5760 $   CLOSE CONFIG
5761 $   'ld' munchconfig.obj,munchconfig.opt/opt
5762 $   DELETE/NOLOG/NOCONFIRM munchconfig.opt;
5763 $ ELSE
5764 $   'ld' munchconfig.obj
5765 $ ENDIF
5766 $ IF F$SEARCH("munchconfig.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.obj;
5767 $ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
5768 $ IF ccname .EQS. "CXX"
5769 $ THEN
5770 $   CALL Cxx_demangler_cleanup
5771 $ ENDIF
5772 $!
5773 $ IF alldone .EQS. ""
5774 $ THEN
5775 $   cat4 SYS$INPUT:
5776 $   DECK
5777
5778 If you'd like to make any changes to the config.sh file before I begin
5779 to configure things, answer yes to the following question.
5780
5781 $   EOD
5782 $   bool_dflt="n"
5783 $   rp="Do you wish to edit ''basename_config_sh'? [''bool_dflt'] "
5784 $   GOSUB myread
5785 $   IF ans
5786 $   THEN
5787 $     echo4 ""
5788 $     echo4 "Be sure to type LOGOUT after you have edited the file,"
5789 $     echo4 "then this procedure will resume."
5790 $     echo4 ""
5791 $     default = F$ENVIRONMENT("DEFAULT")
5792 $     DIRECTORY 'config_sh'
5793 $     SET DEFAULT [-]
5794 $     SPAWN/WAIT
5795 $     SET DEFAULT 'default'
5796 $   ENDIF
5797 $ ENDIF
5798 $!
5799 $ echo ""
5800 $ echo4 "Adding ''osname' specific preprocessor commands."
5801 $ !
5802 $ ! we need an fdl file
5803 $ CREATE [-]CONFIG.FDL
5804 $ DECK
5805 RECORD
5806   FORMAT STREAM_LF
5807 $ EOD
5808 $ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
5809 $ ! First spit out the header info with the local defines (to get
5810 $ ! around the 255 character command line limit)
5811 $ OPEN/APPEND CONFIG [-]config.local
5812 $ IF use_debugging_perl THEN WC "#define DEBUGGING"
5813 $ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
5814 $ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
5815 $ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
5816 $ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
5817 $ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
5818 $ IF (Has_Dec_C_Sockets)
5819 $ THEN
5820 $    WC "#define VMS_DO_SOCKETS"
5821 $    WC "#define DECCRTL_SOCKETS"
5822 $ ELSE
5823 $    IF Has_Socketshr THEN WC "#define VMS_DO_SOCKETS"
5824 $ ENDIF
5825 $! This is VMS-specific for now
5826 $ WC "#''d_setenv' HAS_SETENV"
5827 $ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
5828 $ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
5829 $ IF use64bitint .OR. use64bitint .EQS. "define"
5830 $ THEN
5831 $   WC "#define USE_64_BIT_INT"
5832 $   WC "#define USE_LONG_DOUBLE"
5833 $ ENDIF
5834 $ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
5835     WC "#define USE_64_BIT_ALL"
5836 $ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
5837 $ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
5838 $ WC "#define HAS_ENVGETENV"
5839 $ WC "#define PERL_EXTERNAL_GLOB"
5840 $ IF archname .EQS. "VMS_VAX" .AND. -
5841      ccname .EQS. "DEC" .AND. -
5842      ccversion .LE. 50390006
5843 $ THEN
5844 $! Alas this does not help to build Fcntl
5845 $!   WC "#define PERL_IGNORE_FPUSIG SIGFPE"
5846 $ ENDIF
5847 $ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
5848 $ CLOSE CONFIG
5849 $!
5850 $ echo4 "Doing variable substitutions on .SH files..."
5851 $ echo4 "Extracting config.h (with variable substitutions)"
5852 $!
5853 $! Now build the normal config.h
5854 $ DEFINE/USER_MODE sys$output [-]config.main
5855 $ mcr []munchconfig 'config_sh' [-]config_h.sh
5856 $ ! Concatenate them together
5857 $ copy [-]config.local,[-]config.main [-]config.h
5858 $! Clean up
5859 $ DELETE/NOLOG [-]CONFIG.MAIN;*
5860 $ DELETE/NOLOG [-]CONFIG.LOCAL;*
5861 $ DELETE/NOLOG [-]CONFIG.FDL;*
5862 $!
5863 $ IF ccname .EQS. "DEC"
5864 $ THEN
5865 $   DECC_REPLACE = "DECC=decc=1"
5866 $ ELSE
5867 $   DECC_REPLACE = "DECC="
5868 $ ENDIF
5869 $ IF ccname .EQS. "CXX"
5870 $ THEN
5871 $   DECCXX_REPLACE = "DECCXX=DECCXX=1"
5872 $ ELSE
5873 $   DECCXX_REPLACE = "DECCXX="
5874 $ ENDIF
5875 $ IF ccname .EQS. "GCC"
5876 $ THEN
5877 $   GNUC_REPLACE = "GNUC=gnuc=1"
5878 $ ELSE
5879 $   GNUC_REPLACE = "GNUC=" 
5880 $ ENDIF
5881 $ IF Has_Dec_C_Sockets
5882 $ THEN
5883 $   SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
5884 $ ELSE
5885 $   IF Has_Socketshr
5886 $   THEN
5887 $     SOCKET_REPLACE = "SOCKET=SOCKETSHR_SOCKETS=1"
5888 $   ELSE
5889 $     SOCKET_REPLACE = "SOCKET="
5890 $   ENDIF
5891 $ ENDIF
5892 $ IF Use_Threads
5893 $ THEN
5894 $   IF (vms_ver .LES. "6.2")
5895 $   THEN
5896 $     THREAD_REPLACE = "THREAD=OLDTHREADED=1"
5897 $   ELSE
5898 $     THREAD_REPLACE = "THREAD=THREADED=1"
5899 $   ENDIF
5900 $ ELSE
5901 $   THREAD_REPLACE = "THREAD="
5902 $ ENDIF
5903 $ IF mymalloc
5904 $ THEN
5905 $   MALLOC_REPLACE = "MALLOC=MALLOC=1"
5906 $ ELSE
5907 $   MALLOC_REPLACE = "MALLOC="
5908 $ ENDIF
5909 $ echo4 "Extracting ''defmakefile' (with variable substitutions)"
5910 $ DEFINE/USER_MODE sys$output 'UUmakefile'
5911 $ mcr []munchconfig 'config_sh' 'Makefile_SH' "''DECC_REPLACE'" -
5912  "''DECCXX_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" -
5913  "''THREAD_REPLACE'" "''C_Compiler_Replace'" "''MALLOC_REPLACE'" -
5914  "''Thread_Live_Dangerously'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'"
5915 $! Clean up after ourselves
5916 $ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
5917 $!
5918 $ echo4 "Extracting make_ext.com (without variable substitutions)"
5919 $ Create Sys$Disk:[-]make_ext.com
5920 $ Deck/Dollar="$EndOfTpl$"
5921 $!++ make_ext.com
5922 $!   NOTE: This file is extracted as part of the VMS configuration process.
5923 $!   Any changes made to it directly will be lost.  If you need to make any
5924 $!   changes, please edit the template in Configure.Com instead.
5925 $    def = F$Environment("Default")
5926 $!   p1 - how to invoke miniperl (passed in from descrip.mms)
5927 $    p1 = F$Edit(p1,"Upcase,Compress,Trim")
5928 $    If F$Locate("MCR ",p1).eq.0 Then p1 = F$Extract(3,255,p1)
5929 $    miniperl = "$" + F$Search(F$Parse(p1,".Exe"))
5930 $!   p2 - how to invoke local make utility (passed in from descrip.mms)
5931 $    makeutil = p2
5932 $    if f$type('p2') .nes. "" then makeutil = 'p2'
5933 $!   p3 - make target (passed in from descrip.mms)
5934 $    targ = F$Edit(p3,"Lowercase")
5935 $    sts = 1
5936 $    extensions = ""
5937 $    open/read CONFIG config.sh
5938 $ find_ext_loop:
5939 $    read/end=end_ext_loop CONFIG line
5940 $    if (f$extract(0,12,line) .NES. "extensions='")
5941 $    then goto find_ext_loop
5942 $    else extensions = f$extract(12,f$length(line),line) - "'"
5943 $    endif
5944 $ end_ext_loop:
5945 $    close CONFIG
5946 $    extensions = f$edit(extensions,"TRIM,COMPRESS")
5947 $    i = 0
5948 $ next_ext:
5949 $    ext = f$element(i," ",extensions)
5950 $    If ext .eqs. " " .or. ext .eqs. "" Then Goto done
5951 $    Define/User_mode Perl_Env_Tables CLISYM_LOCAL
5952 $    miniperl
5953 $    deck
5954      ($extdir = $ENV{'ext'}) =~ s/::/./g;
5955      $extdir =~ s#/#.#g;
5956      if ($extdir =~ /^vms/i) { $extdir =~ s/vms/.vms.ext/i; }
5957      else                    { $extdir = ".ext.$extdir";   }
5958      ($ENV{'extdir'} = "[$extdir]");
5959      ($ENV{'up'} = ('-') x ($extdir =~ tr/././));
5960 $    eod
5961 $    Set Default &extdir
5962 $    redesc = 0
5963 $    If F$Locate("clean",targ) .eqs. F$Length(targ)
5964 $    Then
5965 $      Write Sys$Output ""
5966 $      Write Sys$Output "       Making ''ext' (dynamic)"
5967 $      On Error Then Goto done
5968 $      If F$Search("Descrip.MMS") .eqs. ""
5969 $      Then
5970 $        redesc = 1
5971 $      Else
5972 $        If F$CvTime(F$File("Descrip.MMS","rdt")) .lts. -
5973             F$CvTime(F$File("Makefile.PL","rdt")) Then redesc = 1
5974 $      EndIf
5975 $    Else
5976 $      Write Sys$Output "''targ'ing ''ext' . . ."
5977 $      On Error Then Continue
5978 $    EndIf
5979 $    If redesc Then -
5980        miniperl "-I[''up'.lib]" Makefile.PL "INST_LIB=[''up'.lib]" "INST_ARCHLIB=[''up'.lib]"
5981 $    makeutil 'targ'
5982 $    i = i + 1
5983 $    Set Def &def
5984 $    Goto next_ext
5985 $ done:
5986 $    sts = $Status
5987 $    Set Def &def
5988 $    Exit sts
5989 $!-- make_ext.com
5990 $EndOfTpl$
5991 $!
5992 $! Note that the /key qualifier to search, as in:
5993 $! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
5994 $! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
5995 $!
5996 $ echo4 "Extracting extra_pods.com (without variable substitutions)"
5997 $ Create Sys$Disk:[-]extra_pods.com
5998 $ Deck/Dollar="$EOExtra_Pods$"
5999 $!++ extra_pods.com
6000 $!   NOTE: This file is extracted as part of the VMS configuration process.
6001 $!   Any changes made to it directly will be lost.  If you need to make any
6002 $!   changes, please edit the template in Configure.Com instead.
6003 $!   Use FORCE if you've just podified a README.* file on VMS.
6004 $ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
6005     search README.* "=head"/window=0/output=extra.pods
6006 $ open/read/error=extra_close EXTRA extra.pods
6007 $extra_loop:
6008 $ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
6009 $ file_type = f$parse(file,,,"TYPE",) - "."
6010 $ if file_type .nes. "VMS" .and. file_type .nes. "vms"
6011 $ then
6012 $   pod_file = "[.pod]perl''file_type'.pod"
6013 $   file = file - "''f$parse(file,,,"VERSION",)'"
6014 $   if p1 .eqs. "CLEAN"
6015 $   then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
6016 $   else
6017 $     do_copy := false
6018 $     if f$search(pod_file) .eqs. ""
6019 $     then do_copy := true
6020 $     else
6021 $       file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
6022 $       pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
6023 $       if file_rdt .GTS. pod_file_rdt then do_copy := true
6024 $     endif
6025 $     if do_copy then copy/log/noconfirm 'file' 'pod_file'
6026 $   endif
6027 $ endif
6028 $ goto extra_loop
6029 $extra_close:
6030 $ close EXTRA
6031 $ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
6032     purge/nolog extra.pods
6033 $!-- extra_pods.com
6034 $EOExtra_Pods$
6035 $!
6036 $!  Warn of dangerous symbols or logical names
6037 $!
6038 $Bad_environment: SUBROUTINE
6039 $   Bad_env = ""
6040 $   IF p2 .eqs. "SYMBOL"
6041 $   THEN
6042 $     IF f$type('p1') .nes. "" THEN  Bad_env := SYMBOL
6043 $   ELSE
6044 $     IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
6045 $   ENDIF
6046 $   IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
6047 $   THEN
6048 $     IF f$search("config.msg") .nes. ""
6049 $     THEN
6050 $       OPEN/APPEND CONFIG config.msg
6051 $     ELSE
6052 $       OPEN/WRITE CONFIG config.msg
6053 $     ENDIF
6054 $     IF Bad_env .eqs. "SYMBOL"
6055 $     THEN
6056 $       WRITE CONFIG ""
6057 $       WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
6058 $       WRITE CONFIG " delete before building ''package' via:"
6059 $       WRITE CONFIG "     $ DELETE/SYMBOL/GLOBAL ''p1'"
6060 $       IF f$locate("""",&p1) .ge. f$length(&p1)
6061 $       THEN
6062 $       WRITE CONFIG " after building, testing, and installing ''package'"
6063 $       WRITE CONFIG " restore the symbol with:"
6064 $       WRITE CONFIG "     $ ''p1' == """ + &p1 + """"
6065 $       ENDIF
6066 $     ENDIF
6067 $     IF Bad_env .eqs. "LOGICAL"
6068 $     THEN
6069 $       WRITE CONFIG ""
6070 $       WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
6071 $       WRITE CONFIG " deassign before building ''package'"
6072 $     ENDIF
6073 $     CLOSE CONFIG
6074 $     Bad_env = ""
6075 $   ENDIF
6076 $ EXIT
6077 $ ENDSUBROUTINE ! Bad_environment
6078 $ echo ""
6079 $ echo4 "Checking for dangerous pre-existing global symbols and logical names."
6080 $ CALL Bad_environment "TMP"
6081 $ CALL Bad_environment "LIB"
6082 $ CALL Bad_environment "T"
6083 $ CALL Bad_environment "FOO"
6084 $ CALL Bad_environment "EXT"
6085 $ CALL Bad_environment "TEST" "SYMBOL"
6086 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
6087 $!
6088 $! %Config-I-VMS, write perl_setup.com here
6089 $!
6090 $ IF (.NOT.perl_symbol)
6091 $ THEN
6092 $   file_2_find = "[-]''packageup'.cld"
6093 $   echo ""
6094 $   echo4 "The perl.cld file is now being written..."
6095 $   OPEN/WRITE CONFIG 'file_2_find'
6096 $   ext = ".exe"
6097 $   IF (sharedperl .AND. archname .EQS. "VMS_AXP") THEN ext := .AXE
6098 $   IF (use_vmsdebug_perl)
6099 $   THEN
6100 $     WRITE CONFIG "define verb dbgperl"
6101 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
6102 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6103 $     WRITE CONFIG ""
6104 $     WRITE CONFIG "define verb perl"
6105 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
6106 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6107 $   ELSE
6108 $     WRITE CONFIG "define verb perl"
6109 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
6110 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6111 $   ENDIF
6112 $   CLOSE CONFIG
6113 $ ENDIF ! (.NOT.perl_symbol)
6114 $ echo ""
6115 $ echo4 "The perl_setup.com file is now being written..."
6116 $ file_2_find = "[-]perl_setup.com"
6117 $ OPEN/WRITE CONFIG 'file_2_find'
6118 $ WRITE CONFIG "$!"
6119 $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
6120 $ IF cf_email.NES.perladmin
6121 $ THEN
6122 $ WRITE CONFIG "$! perl configured by ''cf_email'"
6123 $ ELSE
6124 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
6125 $ ENDIF
6126 $ WRITE CONFIG "$!"
6127 $ prefix = prefix - "000000."
6128 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
6129     prefix = prefix - "]" + ".]" 
6130 $ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
6131 $ WRITE CONFIG "$ ext = "".exe"""
6132 $ IF sharedperl
6133 $ THEN
6134 $   write config "$ if f$getsyi(""HW_MODEL"") .ge. 1024 then ext = "".AXE"""
6135 $ ENDIF
6136 $ IF (perl_symbol)
6137 $ THEN
6138 $   IF (use_vmsdebug_perl)
6139 $   THEN
6140 $     WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgPerl'ext'"
6141 $     WRITE CONFIG "$ perl    :== $''vms_prefix':[000000]ndbgPerl'ext'"
6142 $     WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
6143 $   ELSE
6144 $     WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
6145 $     WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
6146 $   ENDIF
6147 $ ELSE ! .NOT.perl_symbol
6148 $   IF (use_vmsdebug_perl)
6149 $   THEN
6150 $     WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
6151 $   ELSE
6152 $     WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
6153 $   ENDIF
6154 $   IF perl_verb .EQS. "PROCESS"
6155 $   THEN
6156 $     WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
6157 $   ENDIF
6158 $ ENDIF !  perl_symbol
6159 $ WRITE CONFIG "$ define/nolog pod2text ''vms_prefix':[lib.pod]pod2text.com"
6160 $ WRITE CONFIG "$ define/nolog pod2html ''vms_prefix':[lib.pod]pod2html.com"
6161 $ WRITE CONFIG "$ define/nolog pod2man  ''vms_prefix':[lib.pod]pod2man.com"
6162 $!
6163 $ IF (tzneedset)
6164 $ THEN
6165 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6166 $ ELSE    !leave in but commented out (in case setting was from perl :-)
6167 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6168 $ ENDIF
6169 $ WRITE CONFIG "$!"
6170 $ WRITE CONFIG "$! Symbols for commonly used programs:"
6171 $ WRITE CONFIG "$!"
6172 $ IF (perl_symbol)
6173 $ THEN
6174 $   WRITE CONFIG "$ Perldoc  == ""'"+"'Perl' ''vms_prefix':[lib.pod]Perldoc.com -t"""
6175 $   WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
6176 $   WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
6177 $   WRITE CONFIG "$ pod2latex == ""'"+"'Perl' ''vms_prefix':[lib.pod]pod2latex.com"""
6178 $   WRITE CONFIG "$!pod2man  == ""'"+"'Perl' pod2man"""
6179 $   WRITE CONFIG "$!Perlbug  == ""'"+"'Perl' ''vms_prefix':[lib]Perlbug.com"""
6180 $   WRITE CONFIG "$ c2ph     == ""'"+"'Perl' ''vms_prefix':[utils]c2ph.com"""
6181 $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6182 $   THEN
6183 $     WRITE CONFIG "$ dprofpp     == ""'"+"'Perl' ''vms_prefix':[utils]dprofpp.com"""
6184 $   ENDIF 
6185 $   WRITE CONFIG "$ h2ph     == ""'"+"'Perl' ''vms_prefix':[utils]h2ph.com"""
6186 $   WRITE CONFIG "$ h2xs     == ""'"+"'Perl' ''vms_prefix':[utils]h2xs.com"""
6187 $   WRITE CONFIG "$ libnetcfg == ""'"+"'Perl' ''vms_prefix':[utils]libnetcfg.com"""
6188 $   WRITE CONFIG "$!perlcc   == ""'"+"'Perl' ''vms_prefix':[utils]perlcc.com"""
6189 $   WRITE CONFIG "$ perlivp  == ""'"+"'Perl' ''vms_prefix':[utils]perlivp.com"""
6190 $   WRITE CONFIG "$ splain   == ""'"+"'Perl' ''vms_prefix':[utils]splain.com"""
6191 $   WRITE CONFIG "$ xsubpp   == ""'"+"'Perl' ''vms_prefix':[utils]xsubpp.com"""
6192 $ ELSE
6193 $   WRITE CONFIG "$ Perldoc  == ""Perl ''vms_prefix':[lib.pod]Perldoc.com -t"""
6194 $   WRITE CONFIG "$ pod2text == ""Perl pod2text"""
6195 $   WRITE CONFIG "$ pod2html == ""Perl pod2html"""
6196 $   WRITE CONFIG "$ pod2latex == ""Perl ''vms_prefix':[lib.pod]pod2latex.com"""
6197 $   WRITE CONFIG "$!pod2man  == ""Perl pod2man"""
6198 $   WRITE CONFIG "$!Perlbug  == ""Perl ''vms_prefix':[lib]Perlbug.com"""
6199 $   WRITE CONFIG "$ c2ph     == ""Perl ''vms_prefix':[utils]c2ph.com"""
6200 $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6201 $   THEN
6202 $     WRITE CONFIG "$ dprofpp     == ""Perl ''vms_prefix':[utils]dprofpp.com"""
6203 $   ENDIF 
6204 $   WRITE CONFIG "$ h2ph     == ""Perl ''vms_prefix':[utils]h2ph.com"""
6205 $   WRITE CONFIG "$ h2xs     == ""Perl ''vms_prefix':[utils]h2xs.com"""
6206 $   WRITE CONFIG "$ libnetcfg == ""Perl ''vms_prefix':[utils]libnetcfg.com"""
6207 $   WRITE CONFIG "$!perlcc   == ""Perl ''vms_prefix':[utils]perlcc.com"""
6208 $   WRITE CONFIG "$ perlivp  == ""Perl ''vms_prefix':[utils]perlivp.com"""
6209 $   WRITE CONFIG "$ splain   == ""Perl ''vms_prefix':[utils]splain.com"""
6210 $   WRITE CONFIG "$ xsubpp   == ""Perl ''vms_prefix':[utils]xsubpp.com"""
6211 $ ENDIF
6212 $ CLOSE CONFIG
6213 $!
6214 $ echo  ""
6215 $ echo  "The file can be found at:"
6216 $ echo4 "    ''F$SEARCH(file_2_find)'"
6217 $ echo  "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
6218 $ echo  "when you are satisfied with a successful compilation,"
6219 $ echo  "testing, and installation of your perl."
6220 $ echo  ""
6221 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
6222 $ THEN
6223 $   file_2_find = "[-]''packageup'_install.com"
6224 $   OPEN/WRITE CONFIG 'file_2_find'
6225 $   WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
6226 $   WRITE CONFIG "    /output=sys$common:[syslib]dcltables.exe"
6227 $   WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
6228 $   CLOSE CONFIG
6229 $   echo4 ""
6230 $   echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
6231 $   echo4 "    @ ''F$SEARCH(file_2_find)'"
6232 $   echo4 "after a successful build, test, and install.  Do so with CMKRNL privilege."
6233 $   echo4 ""
6234 $ ENDIF
6235 $!
6236 $!figure out where we "are" by parsing 'vms_default_directory_name' 
6237 $!
6238 $ set_def_command = ""
6239 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
6240 $ tmp = vms_default_directory_name - dflt - "]"
6241 $ i = 0
6242 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
6243 $Set_def_loop:
6244 $ tmp1 = F$ELEMENT(i,".",tmp)
6245 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
6246 $ IF i .EQ. 0 
6247 $ THEN set_def_command = "set default [-"
6248 $ ELSE set_def_command = set_def_command + "-"
6249 $ ENDIF
6250 $ i = i + 1
6251 $ GOTO Set_def_loop
6252 $Beyond_set_def_loop:
6253 $ IF set_def_command.NES.""
6254 $ THEN
6255 $   set_def_command = set_def_command - "-" + "]"
6256 $   echo4 ""
6257 $   echo4 "In order to build ''package' you must now issue the commands:"
6258 $   echo4 ""
6259 $   echo4 " ''set_def_command'"
6260 $ ELSE
6261 $   echo4 ""
6262 $   echo4 "In order to build ''package' you must now issue the command:"
6263 $   echo4 ""
6264 $ ENDIF
6265 $ echo4 " ''make'''makefile'", macros
6266 $ echo4 ""
6267 $!
6268 $ IF ( F$SEARCH("config.msg").NES."" ) 
6269 $ THEN
6270 $   echo "Hmm.  I also noted the following information while running:"
6271 $   echo ""
6272 $   type config.msg
6273 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
6274 $   DELETE/NOLOG/NOCONFIRM config.msg;
6275 $ ENDIF
6276 $!
6277 $Clean_up:
6278 $ SET NOON
6279 $ IF (silent)
6280 $ THEN
6281 $   CLOSE/NOLOG STDOUT
6282 $   DEASSIGN SYS$OUTPUT
6283 $ ENDIF
6284 $ CLOSE/NOLOG CONFIG
6285 $ IF F$GETJPI("","FILCNT").GT.vms_filcnt
6286 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
6287 $ ENDIF
6288 $ dflt = F$ENVIRONMENT("DEFAULT")
6289 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
6290 $ THEN
6291 $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
6292 $   SET DEFAULT [-]
6293 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
6294 $   DELETE/NOLOG/NOCONFIRM UU.DIR;
6295 $ ENDIF
6296 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
6297 $ EXIT
6298 $!: End of Configure