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