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