Implement nonxs_ext on VMS.
[p5sagit/p5-mst-13.2.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/" THEN goto ext_loop
2729 $   line = F$EDIT(line,"COMPRESS")
2730 $   line = F$ELEMENT(0," ",line)
2731 $   IF F$EXTRACT(0,4,line) .EQS. "ext/"
2732 $   THEN
2733 $     xxx = F$ELEMENT(1,"/",line)
2734 $     IF F$SEARCH("[-.ext]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2735 $   ENDIF
2736 $   IF xxx .EQS. "DynaLoader" THEN goto ext_loop     ! omit
2737 $!
2738 $! (extspec = xxx) =~ tr!-!/!
2739 $ extspec = ""
2740 $ idx = 0
2741 $ extension_dir_name = xxx
2742 $ replace_dash_with_slash:
2743 $   before = F$ELEMENT(idx, "-", xxx)
2744 $   IF before .EQS. "-" THEN goto end_replace_dash_with_slash
2745 $   IF extspec .NES. "" 
2746 $   THEN
2747 $       extspec = extspec + "/"
2748 $   ENDIF
2749 $   extspec = extspec + before
2750 $   idx = idx + 1
2751 $   goto replace_dash_with_slash
2752 $
2753 $ end_replace_dash_with_slash:
2754 $   
2755 $ xxx = known_extensions
2756 $ gosub may_already_have_extension
2757 $ IF $STATUS .EQ. 1
2758 $ THEN
2759 $     xxx = nonxs_ext
2760 $     gosub may_already_have_extension
2761 $ ENDIF
2762 $ IF $STATUS .NE. 1 THEN goto ext_loop
2763 $ goto found_new_extension
2764 $!
2765 $ may_already_have_extension:
2766 $   idx = F$LOCATE(extspec, xxx)
2767 $   extlen = F$LENGTH(xxx) 
2768 $   IF idx .EQ. extlen THEN return 1
2769 $!  But "Flirble" may just be part of "Acme-Flirble"
2770 $   IF idx .GT. 0 .AND. F$EXTRACT(idx - 1, 1, xxx) .NES. " "
2771 $   THEN
2772 $       xxx = F$EXTRACT(idx + F$LENGTH(extspec) + 1, extlen, xxx)
2773 $       GOTO may_already_have_extension
2774 $   ENDIF
2775 $!  But "Foo" may just be part of "Foo-Bar" so check for equality.
2776 $   xxx = F$EXTRACT(idx, extlen - idx, xxx)
2777 $   IF F$ELEMENT(0, " ", xxx) .EQS. extspec
2778 $   THEN 
2779 $       RETURN 3
2780 $   ELSE 
2781 $       xxx = F$EXTRACT(F$LENGTH(extspec) + 1, extlen, xxx)
2782         GOTO may_already_have_extension
2783 $   ENDIF
2784 $!
2785 $ found_new_extension:
2786 $   IF F$SEARCH("[-.ext.''extension_dir_name']*.xs") .NES. ""
2787 $   THEN
2788 $       known_extensions = known_extensions + " ''extspec'"
2789 $   ELSE
2790 $       nonxs_ext = nonxs_ext + " ''extspec'"
2791 $   ENDIF
2792 $   goto ext_loop
2793 $end_ext:
2794 $ close CONFIG
2795 $ DELETE/SYMBOL xxx
2796 $ DELETE/SYMBOL idx
2797 $ DELETE/SYMBOL extspec
2798 $ DELETE/SYMBOL extlen
2799 $ DELETE/SYMBOL extension_dir_name
2800 $ known_extensions = F$EDIT(known_extensions,"TRIM,COMPRESS")
2801 $ dflt = known_extensions
2802 $ IF ccname .NES. "DEC" .AND. ccname .NES. "CXX"
2803 $ THEN
2804 $   dflt = dflt - "POSIX"             ! not with VAX C or GCC
2805 $ ENDIF
2806 $ dflt = dflt - "ByteLoader"          ! needs to be ported
2807 $ dflt = dflt - "DB_File"             ! needs to be ported
2808 $ dflt = dflt - "GDBM_File"           ! needs porting/special library
2809 $ dflt = dflt - "IPC/SysV"            ! needs to be ported
2810 $ dflt = dflt - "NDBM_File"           ! needs porting/special library
2811 $ dflt = dflt - "ODBM_File"           ! needs porting/special library
2812 $ dflt = dflt - "Sys/Syslog"          ! needs porting/special library "GDBM_File macro LOG_DEBUG"
2813 $ IF .NOT. Has_socketshr .AND. .NOT. Has_Dec_C_Sockets
2814 $ THEN
2815 $   dflt = dflt - "Socket"            ! optional on VMS
2816 $ ENDIF
2817 $ dflt = dflt - "Win32API/File" - "Win32"  ! need Dave Cutler's other project
2818 $ nonxs_ext = nonxs_ext - "Win32CORE"
2819 $ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2820 $ nonxs_ext = F$EDIT(nonxs_ext,"TRIM,COMPRESS")
2821 $!
2822 $! Ask for their default list of extensions to build
2823 $ echo ""
2824 $ echo "It is time to specify which modules you want to build into"
2825 $ echo "perl. Most of these are standard and should be chosen, though"
2826 $ echo "you might, for example, want to build GDBM_File instead of"
2827 $ echo "SDBM_File if you have the GDBM library built on your machine."
2828 $ echo ""
2829 $ echo "Which modules do you want to build into perl?"
2830 $ rp = "[''dflt'] "
2831 $ GOSUB myread
2832 $ extensions = F$EDIT(ans,"TRIM,COMPRESS")
2833 $!
2834 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2835 $ echo ""
2836 $ echo "Checking your ""make"" utilities..."
2837 $! If the 'build' that you use is not here add it and it's test
2838 $! switch to the _END_ of these strings (and increment max_build)
2839 $! (e.g. builders = builders + "/FOOMAKE" 
2840 $!       probers  = probers + " -fooVersionSwitch"
2841 $! ) & please let me know about it.
2842 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2843 $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2844 $ max_build = 7
2845 $!
2846 $ orig_dflt = f$edit(builder,"UPCASE")
2847 $ if orig_dflt .eqs. "" then orig_dflt = "MMK"
2848 $ default_set = ""
2849 $ ok_builders = ""
2850 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2851 $ WRITE CONFIG "dont_make_anything_yet:"
2852 $ WRITE CONFIG F$FAO("!_")
2853 $ CLOSE CONFIG
2854 $ n = 0
2855 $ messages = F$ENVIRONMENT("MESSAGE")
2856 $Build_probe:
2857 $ build = F$ELEMENT(n,"/",builders)
2858 $ probe  = F$ELEMENT(n,"!",probers)
2859 $ echo "Testing whether you have ''build' on your system..."
2860 $!
2861 $! Noted with GNU Make version 3.60  that the $status and $severity
2862 $! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2863 $! $SEVERITY == "4".
2864 $!
2865 $ SET NOON
2866 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2867 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2868 $ 'build' 'probe'
2869 $ IF ($SEVERITY .EQ. 1) ! not adequate?
2870 $ THEN 
2871 $   echo "OK."
2872 $   IF (build .EQS. orig_dflt) 
2873 $   THEN 
2874 $     default_set = "TRUE"
2875 $     dflt = build
2876 $   ENDIF
2877 $   ok_builders = ok_builders + " " + build
2878 $   IF (.NOT. default_set) THEN dflt = build
2879 $ ELSE 
2880 $   echo "Nope."
2881 $ ENDIF
2882 $Reenable_messages_build:
2883 $ SET MESSAGE 'messages'
2884 $ SET ON
2885 $ on control_y then goto clean_up
2886 $ n = n + 1
2887 $ IF (n .LT. max_build) THEN GOTO Build_probe
2888 $!
2889 $ echo ""
2890 $ IF (ok_builders .NES. "") 
2891 $ THEN
2892 $   echo "Here is the list of builders you can apparently use:"
2893 $   echo "(",ok_builders," )"
2894 $   rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
2895 $   GOSUB myread
2896 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2897 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2898 $   IF (ans .EQS. "") 
2899 $   THEN build = dflt
2900 $   ELSE build = ans
2901 $   ENDIF
2902 $ ELSE
2903 $   TYPE SYS$INPUT:
2904 $   DECK
2905
2906 %Config-E-VMS, ERROR:
2907  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2908  utility of some sort and after checking my "builders" list I cannot find
2909  the symbol or command you use on your system to compile programs.
2910
2911 $   EOD
2912 $   READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
2913 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2914 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2915 $   IF (ans .EQS. "") 
2916 $   THEN build = dflt
2917 $     echo "I do not know where ""make"" is, and my life depends on it."
2918 $     echo "Go find a make program or fix your DCL$PATH setting!"
2919 $     echo "ABORTING..."
2920 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
2921 $     STOP
2922 $     EXIT 2 !$STATUS = "%X00000002" (error)
2923 $   ELSE 
2924 $     build = ans
2925 $   ENDIF
2926 $ ENDIF
2927 $!
2928 $ DELETE/NOLOG/NOCONFIRM Makefile.;
2929 $ GOTO Beyond_open
2930 $Open_error:
2931 $ TYPE SYS$INPUT:
2932 $ DECK
2933
2934  There seems to be trouble. I just tried to create a file in
2935 $ EOD
2936 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2937 $ TYPE SYS$INPUT:
2938 $ DECK
2939  but was unsuccessful. I am stopping now. Please check that directories'
2940  PROTECTION bits. I will leave you in the directory where you started
2941  Configure.com
2942 $ EOD
2943 $ echo4 "ABORTING..."
2944 $ GOTO Clean_up
2945 $ STOP
2946 $ EXIT
2947 $!
2948 $Beyond_open:
2949 $! echo " Very well I will proceed with ""''build'"""
2950 $ make = F$EDIT(build,"UPCASE")
2951 $!
2952 $!: locate the preferred pager for this system
2953 $!pagers = "most|more|less|type/page"
2954 $ IF osvers .GES. "V6.1"
2955 $ THEN
2956 $   dflt = "type/page=save=10"
2957 $ ELSE
2958 $   dflt = "type/page"
2959 $ ENDIF
2960 $! assume that the presence of a most symbol indicates the presence
2961 $! of the pager.
2962 $ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
2963 $ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
2964 $ rp="What pager is used on your system? [''dflt'] "
2965 $ GOSUB myread
2966 $ pager = ans
2967 $!
2968 $! update makefile here
2969 $! echo4 "Updating makefile..."
2970 $!
2971 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2972 $ THEN 
2973 $   makefile    = ""               !wrt MANIFEST dir
2974 $   UUmakefile  = "[-]DESCRIP.MMS" !wrt CWD dir
2975 $   DEFmakefile = "DESCRIP.MMS"    !wrt DEF dir (?)
2976 $   Makefile_SH = "descrip_mms.template"
2977 $ ELSE
2978 $   makefile    = " -f Makefile."  !wrt MANIFEST dir
2979 $   UUmakefile  = "[-]Makefile."   !wrt CWD dir
2980 $   DEFmakefile = "Makefile."      !wrt DEF dir (?)
2981 $   Makefile_SH = "Makefile.in"
2982 $ ENDIF
2983 $!
2984 $ IF macros .NES. "" 
2985 $ THEN
2986 $   tmp = F$LENGTH(macros)
2987 $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2988 $   macros = "/macro=(" + macros  + ")"
2989 $ ENDIF
2990 $! Build up the extra C flags
2991 $!
2992 $ IF use_ieee_math
2993 $ THEN
2994 $   extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm"
2995 $ ELSE
2996 $   IF (archname.EQS."VMS_IA64")
2997 $   THEN
2998 $     extra_flags = "''extra_flags'" + "/float=g_float"
2999 $   ENDIF
3000 $ ENDIF
3001 $ IF be_case_sensitive
3002 $ THEN
3003 $   extra_flags = "''extra_flags'" + "/Names=As_Is"
3004 $ ENDIF
3005 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
3006 $!
3007 $ min_pgflquota = "100000"
3008 $ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
3009 $ IF pgflquota .LES. min_pgflquota
3010 $ THEN
3011 $   echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
3012 $   READ SYS$COMMAND/PROMPT="Continue? [n] " ans
3013 $   IF ans
3014 $   THEN
3015 $     echo4 "Continuing..."
3016 $   ELSE
3017 $     echo4 "ABORTING..."
3018 $     GOTO Clean_up
3019 $   ENDIF
3020 $ ENDIF
3021 $!
3022 $! PerlIO abstraction
3023 $!
3024 $ bool_dflt = "y"
3025 $ IF F$TYPE(useperlio) .NES. ""
3026 $ then
3027 $   if f$extract(0,1,f$edit(useperlio,"collapse,upcase")) .eqs. "N" .or. useperlio .eqs. "undef" then bool_dflt = "n"
3028 $ endif
3029 $ IF .NOT. silent
3030 $ THEN
3031 $   echo "Previous versions of ''package' used the standard IO mechanisms as"
3032 $   TYPE SYS$INPUT:
3033 $   DECK
3034 defined in <stdio.h>.  Versions 5.003_02 and later of perl allow
3035 alternate IO mechanisms via the PerlIO abstraction layer, but the
3036 stdio mechanism is still available if needed.  The abstraction layer
3037 can use AT&T's sfio (if you already have sfio installed) or regular stdio.
3038 Using PerlIO with sfio may cause problems with some extension modules.
3039
3040 $   EOD
3041 $   echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
3042 $ ENDIF
3043 $ rp = "Use the PerlIO abstraction layer? [''bool_dflt'] "
3044 $ GOSUB myread
3045 $ IF ans
3046 $ THEN
3047 $   useperlio = "define"
3048 $ ELSE
3049 $   echo "Ok, doing things the stdio way."
3050 $   useperlio = "undef"
3051 $ ENDIF
3052 $!
3053 $ echo ""
3054 $ echo4 "Checking the C run-time library."
3055 $!
3056 $! Former SUBCONFIGURE.COM
3057 $!
3058 $!  - build a config.sh for VMS Perl.
3059 $!  - use built config.sh to take config_h.SH -> config.h
3060 $!  - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
3061 $!              vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
3062 $!              vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
3063 $!
3064 $! Note for folks from other platforms changing things in here:
3065 $!
3066 $!   Fancy changes (based on compiler capabilities or VMS version or
3067 $!   whatever) are tricky, so go ahead and punt on those.
3068 $!
3069 $!   Simple changes, though (say, always setting something to 1, or undef,
3070 $!   or something like that) are straightforward.  Adding a new constant 
3071 $!   item for the ultimately created config.sh requires at least one 
3072 $!   (possibly more) line(s) to this file.
3073 $!
3074 $!   Add a line in the format:
3075 $!
3076 $!     $ WC "foo='undef'"
3077 $!
3078 $!   somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
3079 $!   and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
3080 $!   is sorted ASCII and corresponds to the output of config.sh in the 
3081 $!   Bourne shell version of Configure).
3082 $!   Be very careful with quoting, as it can be tricky.
3083 $!   For example if instead of a constant string like 'undef' or 'define' 
3084 $!   you wanted to add something to VMS's config.sh that looks like:
3085 $!
3086 $!     blank_string=''
3087 $!
3088 $!   then add a line that looks like this before the 
3089 $!   '##END WRITE NEW CONSTANTS HERE##' tagged line:
3090 $!
3091 $!     $ WC "blank_string='" + "'"
3092 $!
3093 $!   (+ is the string concatenator and "''var'" has the effect 
3094 $!    of "${var}" in perl or sh, but "'const'" is not interpolated).
3095 $!
3096 $!   Note that unitialized variables, such as a line like:
3097 $!
3098 $!     $ WC "new_var='" + new_var + "'"
3099 $!
3100 $!   should be avoided unless new_var has a value assigned prior 
3101 $!   to that line (think of perl's -w warnings).
3102 $!
3103 $!     %DCL-W-UNDSYM, undefined symbol - check validity and spelling
3104 $!     \NEW_VAR\
3105 $!
3106 $!
3107 $ vms_ver = F$EXTRACT(1,3, osvers)
3108 $ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
3109 $ MCC = f$edit(mcc, "UPCASE")
3110 $ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
3111 $ IF ccname .EQS. "DEC"
3112 $ THEN
3113 $   Checkcc := "''Mcc'/prefix=all"
3114 $ ELSE
3115 $   IF ccname .EQS. "CXX"
3116 $   THEN
3117 $     Checkcc := cxx
3118 $   ELSE
3119 $     Checkcc := "''Mcc'"
3120 $   ENDIF
3121 $ ENDIF
3122 $ ccflags = ccflags + extra_flags
3123 $ IF be_case_sensitive
3124 $ THEN
3125 $   d_vms_be_case_sensitive = "define"
3126 $ ELSE
3127 $   d_vms_be_case_sensitive = "undef"
3128 $ ENDIF
3129 $! Some constant defaults.
3130 $ hwname = f$getsyi("HW_NAME")
3131 $ myname = myhostname
3132 $ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
3133 $!
3134 $ ccdlflags=""
3135 $ cccdlflags=""
3136 $!
3137 $! FIXME -- This section does not really handle all the different permutations 
3138 $! of 64-bitness, and it does not provide for the /POINTER_SIZE=64 compiler
3139 $! option that would be necessary to support the "explicit 64-bit interfaces"
3140 $! promised by -Dusemorebits.
3141 $!
3142 $ usemorebits = "undef"
3143 $ IF use64bitint .OR. use64bitint .EQS. "define"
3144 $ THEN
3145 $   use64bitint = "define"
3146 $   ivdformat="""Ld"""
3147 $   uvuformat="""Lu"""
3148 $   uvoformat="""Lo"""
3149 $   uvxformat="""Lx"""
3150 $   uvXUformat="""LX"""
3151 $ ELSE
3152 $   use64bitint = "undef"
3153 $   ivdformat="""ld"""
3154 $   uvuformat="""lu"""
3155 $   uvoformat="""lo"""
3156 $   uvxformat="""lx"""
3157 $   uvXUformat="""lX"""
3158 $ ENDIF
3159 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
3160 $ THEN
3161 $   uselongdouble = "define"
3162 $   alignbytes="16"
3163 $   nveformat="""Le"""
3164 $   nvfformat="""Lf"""
3165 $   nvgformat="""Lg"""
3166 $ ELSE
3167 $   uselongdouble = "undef"
3168 $   nveformat="""e"""
3169 $   nvfformat="""f"""
3170 $   nvgformat="""g"""
3171 $ ENDIF
3172 $ IF use64bitall .OR. use64bitall .EQS. "define"
3173 $ THEN
3174 $   use64bitall = "define"
3175 $ ELSE
3176 $   use64bitall = "undef"
3177 $ ENDIF
3178 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
3179 $ THEN
3180 $   uselargefiles = "define"
3181 $ ELSE
3182 $   uselargefiles = "undef"
3183 $ ENDIF
3184 $!
3185 $ usemymalloc = "undef"
3186 $ if mymalloc then usemymalloc = "define"
3187 $!
3188 $ perl_cc=Mcc
3189 $!
3190 $ IF (sharedperl .AND. archname .EQS. "VMS_AXP")
3191 $ THEN
3192 $   obj_ext=".abj"
3193 $   so="axe"
3194 $   dlext="axe"
3195 $   exe_ext=".axe"
3196 $   lib_ext=".alb"
3197 $ ELSE
3198 $   IF (sharedperl .AND. archname .EQS. "VMS_IA64")
3199 $   THEN
3200 $     obj_ext=".ibj"
3201 $     so="ixe"
3202 $     dlext="ixe"
3203 $     exe_ext=".ixe"
3204 $     lib_ext=".ilb"
3205 $   ELSE
3206 $     obj_ext=".obj"
3207 $     so="exe"
3208 $     dlext="exe"
3209 $     exe_ext=".exe"
3210 $     lib_ext=".olb"
3211 $   ENDIF
3212 $ ENDIF
3213 $ dlobj="dl_vms''obj_ext'"
3214 $!
3215 $ cppstdin="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3216 $ cppminus=" "
3217 $ cpprun="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3218 $ cpplast=" "
3219 $!
3220 $ timetype="time_t"
3221 $ signal_t="void"
3222 $ stdchar="char"
3223 $!
3224 $ IF mymalloc
3225 $ THEN d_mymalloc="define"
3226 $ ELSE d_mymalloc="undef"
3227 $ ENDIF
3228 $!
3229 $ usedevel="undef"
3230 $ usedl="define"
3231 $ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
3232 $ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
3233 $!
3234 $ IF ((use_threads) .AND. (vms_ver .LES. "6.2"))
3235 $ THEN
3236 $   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"
3237 $ ELSE
3238 $   libs=" "
3239 $ ENDIF
3240 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
3241 $ THEN
3242 $   libc="(DECCRTL)"
3243 $ ELSE
3244 $   libc=" "
3245 $ ENDIF
3246 $!
3247 $! perllibs should be libs with all non-core libs (such as gdbm) removed.
3248 $!
3249 $ perllibs=libs
3250 $!
3251 $!
3252 $ IF archname .NES. "VMS_VAX"
3253 $ THEN
3254 $   d_PRId64 = "define"
3255 $   d_PRIu64 = "define"
3256 $   d_PRIo64 = "define"
3257 $   d_PRIx64 = "define"
3258 $   d_PRIXU64 = "define"
3259 $   sPRId64 = """Ld"""
3260 $   sPRIXU64 = """LX"""
3261 $   sPRIi64 = """Li"""
3262 $   sPRIo64 = """Lo"""
3263 $   sPRIu64 = """Lu"""
3264 $   sPRIx64 = """Lx"""
3265 $   d_quad = "define"
3266 $   quadtype = "long long"
3267 $   uquadtype = "unsigned long long"
3268 $   quadkind  = "3"
3269 $!
3270 $   d_frexpl = "define"
3271 $   d_modfl = "define"
3272 $   d_modflproto = "define"
3273 $ ELSE
3274 $   d_PRId64 = "undef"
3275 $   d_PRIXU64 = "undef"
3276 $   d_PRIu64 = "undef"
3277 $   d_PRIo64 = "undef"
3278 $   d_PRIx64 = "undef"
3279 $   sPRId64 = ""
3280 $   sPRIXU64 = """lX"""
3281 $   sPRIi64 = ""
3282 $   sPRIo64 = ""
3283 $   sPRIu64 = ""
3284 $   sPRIx64 = ""
3285 $   d_quad = "undef"
3286 $   quadtype = "undef"
3287 $   uquadtype = "undef"
3288 $   quadkind  = "undef"
3289 $!
3290 $   d_frexpl = "undef"
3291 $   d_modfl = "undef"
3292 $   d_modflproto = "undef"
3293 $ ENDIF
3294 $!
3295 $ IF useieee .OR. useieee .EQS. "define"
3296 $ THEN
3297 $   d_isnan = "define"
3298 $   d_isnanl = "define"
3299 $ ELSE
3300 $   d_isnan = "undef"
3301 $   d_isnanl = "undef"
3302 $ ENDIF
3303 $!
3304 $! Now some that we build up
3305 $!
3306 $ IF use_threads
3307 $ THEN
3308 $   IF use_5005_threads
3309 $   THEN
3310 $     arch = "''arch'-thread"
3311 $     archname = "''archname'-thread"
3312 $     d_old_pthread_create_joinable = "undef"
3313 $     old_pthread_create_joinable = " "
3314 $     use5005threads = "define"
3315 $     useithreads = "undef"
3316 $   ELSE
3317 $     arch = "''arch'-ithread"
3318 $     archname = "''archname'-ithread"
3319 $     d_old_pthread_create_joinable = "undef"
3320 $     old_pthread_create_joinable = " "
3321 $     use5005threads = "undef"
3322 $     useithreads = "define"
3323 $   ENDIF
3324 $ ELSE
3325 $   d_old_pthread_create_joinable = "undef"
3326 $   old_pthread_create_joinable = " "
3327 $   use5005threads = "undef"
3328 $   useithreads = "undef"
3329 $ ENDIF
3330 $!
3331 $! Some that we need to invoke the compiler for
3332 $!
3333 $!
3334 $! handy construction aliases/symbols
3335 $!
3336 $ OS := "open/write CONFIG []try.c"
3337 $ WS := "write CONFIG"
3338 $ CS := "close CONFIG"
3339 $ DS := "delete/nolog/noconfirm []try.*;*"
3340 $ Needs_Opt := N
3341 $ good_compile = %X10B90001
3342 $ IF ccname .EQS. "GCC"
3343 $ THEN
3344 $   open/write OPTCHAN []try.opt
3345 $   write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3346 $   write OPTCHAN "Sys$Share:VAXCRTL/Share"
3347 $   Close OPTCHAN
3348 $   Needs_Opt := Y
3349 $   good_compile = %X10000001
3350 $ ENDIF
3351 $ IF ccname .EQS. "CXX"
3352 $ THEN
3353 $   good_compile = %X15F60001
3354 $ ENDIF
3355 $ good_link = %X10000001
3356 $ tmp = "" ! null string default
3357 $!
3358 $ GOTO beyond_compile_ok
3359 $!
3360 $! Check for type sizes 
3361 $!
3362 $type_size_check: 
3363 $!
3364 $ OS
3365 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3366 $ WS "#include <stdlib.h>"
3367 $ WS "#endif"
3368 $ WS "#include <stdio.h>"
3369 $ WS "int main()"
3370 $ WS "{"
3371 $ WS "printf(""%d\n"", sizeof(''tmp'));"
3372 $ WS "exit(0);"
3373 $ WS "}"
3374 $ CS
3375 $ GOSUB compile
3376 $ RETURN
3377 $!
3378 $!: locate header file
3379 $findhdr:
3380 $!
3381 $ OS
3382 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3383 $ WS "#include <stdlib.h>"
3384 $ WS "#endif"
3385 $ WS "#include <stdio.h>"
3386 $ WS "#include <''tmp'>"
3387 $ WS "int main()"
3388 $ WS "{"
3389 $ WS "printf(""define\n"");"
3390 $ WS "exit(0);"
3391 $ WS "}"
3392 $ CS
3393 $ GOSUB link_ok
3394 $ RETURN
3395 $!
3396 $!: define an alternate in-header-list? function
3397 $inhdr:
3398 $!
3399 $ GOSUB findhdr
3400 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3401 $ THEN
3402 $   echo4 "<''tmp'> found."
3403 $   tmp = "define"
3404 $ ELSE
3405 $   echo4 "<''tmp'> NOT found."
3406 $   tmp = "undef"
3407 $ ENDIF
3408 $ RETURN
3409 $!
3410 $!: define an is-in-libc? function
3411 $inlibc: 
3412 $ GOSUB link_ok
3413 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3414 $ THEN
3415 $   echo4 "''tmp'() found."
3416 $   tmp = "define"
3417 $ ELSE
3418 $   echo4 "''tmp'() NOT found."
3419 $   tmp = "undef"
3420 $ ENDIF
3421 $ RETURN
3422 $!
3423 $!: define a shorthand compile call
3424 $compile:
3425 $ GOSUB link_ok
3426 $just_mcr_it:
3427 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3428 $ THEN
3429 $   OPEN/WRITE CONFIG []try.out
3430 $   DEFINE/USER_MODE SYS$ERROR CONFIG
3431 $   DEFINE/USER_MODE  SYS$OUTPUT CONFIG
3432 $   MCR []try.exe
3433 $   CLOSE CONFIG
3434 $   OPEN/READ CONFIG []try.out
3435 $   READ CONFIG tmp
3436 $   CLOSE CONFIG
3437 $   DELETE/NOLOG/NOCONFIRM []try.out;
3438 $   DELETE/NOLOG/NOCONFIRM []try.exe;
3439 $ ELSE
3440 $   tmp = "" ! null string default
3441 $ ENDIF
3442 $ RETURN
3443 $!
3444 $link_ok:
3445 $ GOSUB compile_ok
3446 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3447 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3448 $ SET NOON
3449 $ IF Needs_Opt
3450 $ THEN
3451 $   'ld' try.obj,try.opt/opt
3452 $   link_status = $status
3453 $ ELSE
3454 $   'ld' try.obj
3455 $   link_status = $status
3456 $ ENDIF
3457 $ SET ON
3458 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3459 $ RETURN
3460 $!
3461 $!: define a shorthand compile call for compilations that should be ok.
3462 $compile_ok:
3463 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3464 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3465 $ SET NOON
3466 $ 'Checkcc' try.c
3467 $ compile_status = $status
3468 $ SET ON
3469 $ DELETE/NOLOG/NOCONFIRM try.c;
3470 $ RETURN
3471 $!
3472 $beyond_compile_ok:
3473 $!
3474 $! Check for __STDC__
3475 $!
3476 $ OS
3477 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3478 $ WS "#include <stdlib.h>"
3479 $ WS "#endif"
3480 $ WS "#include <stdio.h>"
3481 $ WS "int main()"
3482 $ WS "{"
3483 $ WS "#ifdef __STDC__"
3484 $ WS "printf(""42\n"");"
3485 $ WS "#else"
3486 $ WS "printf(""1\n"");"
3487 $ WS "#endif"
3488 $ WS "exit(0);"
3489 $ WS "}"
3490 $ CS
3491 $ GOSUB compile
3492 $ cpp_stuff=tmp
3493 $ IF F$INTEGER(tmp) .eq. 42
3494 $ THEN
3495 $   echo4 "Your C compiler and pre-processor defines the symbol:"
3496 $   echo4 "__STDC__"
3497 $ ENDIF
3498 $!
3499 $! Check for double size
3500 $!
3501 $ echo4 "Checking to see how big your double precision numbers are..."
3502 $ tmp="double"
3503 $ GOSUB type_size_check
3504 $ doublesize = tmp
3505 $ echo "Your double is ''doublesize' bytes long."
3506 $!
3507 $! Check for long double size
3508 $!
3509 $ OS
3510 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3511 $ WS "#pragma message disable ALL"  ! VAX compilers may have distracting informationals
3512 $ WS "#include <stdlib.h>"
3513 $ WS "#endif"
3514 $ WS "#include <stdio.h>"
3515 $ WS "int main()"
3516 $ WS "{"
3517 $ WS "printf(""%d\n"", sizeof(long double));"
3518 $ WS "exit(0);"
3519 $ WS "}"
3520 $ CS
3521 $ echo4 "Checking to see if you have long double..."
3522 $ GOSUB link_ok
3523 $ IF link_status .NE. good_link
3524 $ THEN
3525 $   longdblsize="0"
3526 $   d_longdbl="undef"
3527 $   echo "You do not have long double."
3528 $ ELSE
3529 $   echo "You have long double."
3530 $   echo4 "Checking to see how big your long doubles are..."
3531 $   GOSUB just_mcr_it
3532 $   longdblsize = tmp
3533 $   d_longdbl = "define"
3534 $   echo "Your long doubles are ''longdblsize' bytes long."
3535 $ ENDIF
3536 $!
3537 $ IF d_longdbl .OR. d_longdbl .EQS. "define"
3538 $ THEN
3539 $   d_PRIEUldbl = "define"
3540 $   d_PRIFUldbl = "define"
3541 $   d_PRIGUldbl = "define"
3542 $   d_PRIeldbl = "define"
3543 $   d_PRIfldbl = "define"
3544 $   d_PRIgldbl = "define"
3545 $   sPRIEUldbl = """LE"""
3546 $   sPRIFUldbl = """LF"""
3547 $   sPRIGUldbl = """LG"""
3548 $   sPRIeldbl = """Le"""
3549 $   sPRIfldbl = """Lf"""
3550 $   sPRIgldbl = """Lg"""
3551 $ ELSE
3552 $   d_PRIEUldbl = "undef"
3553 $   d_PRIFUldbl = "undef"
3554 $   d_PRIGUldbl = "undef"
3555 $   d_PRIeldbl = "undef"
3556 $   d_PRIfldbl = "undef"
3557 $   d_PRIgldbl = "undef"
3558 $   sPRIEUldbl = ""
3559 $   sPRIFUldbl = ""
3560 $   sPRIGUldbl = ""
3561 $   sPRIeldbl = ""
3562 $   sPRIfldbl = ""
3563 $   sPRIgldbl = ""
3564 $ ENDIF
3565 $ d_SCNfldbl = d_PRIfldbl
3566 $ sSCNfldbl = sPRIfldbl ! expect consistency
3567 $!
3568 $!: check for long long
3569 $ OS
3570 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3571 $ WS "#include <stdlib.h>"
3572 $ WS "#endif"
3573 $ WS "#include <stdio.h>"
3574 $ WS "int main()"
3575 $ WS "{"
3576 $ WS "printf(""%d\n"", sizeof(long long));"
3577 $ WS "exit(0);"
3578 $ WS "}"
3579 $ CS
3580 $ echo4 "Checking to see if you have long long..."
3581 $ GOSUB link_ok
3582 $ IF link_status .NE. good_link
3583 $ THEN
3584 $   longlongsize="0"
3585 $   d_longlong="undef"
3586 $   echo "You do not have long long."
3587 $ ELSE
3588 $   echo "You have long long."
3589 $   echo4 "Checking to see how big your long longs are..."
3590 $   GOSUB just_mcr_it
3591 $   longlongsize = tmp
3592 $   d_longlong = "define"
3593 $   echo "Your long longs are ''longlongsize' bytes long."
3594 $ ENDIF
3595 $!
3596 $! Check the prototype for getgid
3597 $!
3598 $ echo "Looking for the type for group ids returned by getgid()."
3599 $ OS
3600 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3601 $ WS "#include <stdlib.h>"
3602 $ WS "#endif"
3603 $ WS "#include <stdio.h>"
3604 $ WS "#include <types.h>"
3605 $ WS "int main()"
3606 $ WS "{"
3607 $ WS "gid_t foo;"
3608 $ WS "exit(0);"
3609 $ WS "}"
3610 $ CS
3611 $ GOSUB compile_ok
3612 $ IF compile_status .NE. good_compile
3613 $ THEN
3614 $!   Okay, gid_t failed. Must be unsigned int
3615 $   gidtype = "unsigned int"
3616 $   echo4 "assuming ""''gidtype'""."
3617 $ ELSE
3618 $   gidtype = "gid_t"
3619 $   echo4 "gid_t found."
3620 $ ENDIF
3621 $!
3622 $! Check to see if we've got dev_t
3623 $!
3624 $ echo "Looking for the type for dev."
3625 $ OS
3626 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3627 $ WS "#include <stdlib.h>"
3628 $ WS "#endif"
3629 $ WS "#include <stdio.h>"
3630 $ WS "#include <types.h>"
3631 $ WS "int main()"
3632 $ WS "{"
3633 $ WS "dev_t foo;"
3634 $ WS "exit(0);"
3635 $ WS "}"
3636 $ CS
3637 $ GOSUB compile_ok
3638 $ IF compile_status .NE. good_compile
3639 $ THEN
3640 $!   Okay, dev_t failed. Must be unsigned int
3641 $   devtype = "unsigned int"
3642 $   echo4 "assuming ""''devtype'""."
3643 $ ELSE
3644 $   devtype = "dev_t"
3645 $   echo4 "dev_t found."
3646 $ ENDIF
3647 $!
3648 $! Check to see if we've got unistd.h (which we ought to, but you never know)
3649 $!
3650 $ i_netdb = "undef"
3651 $ tmp = "unistd.h"
3652 $ GOSUB inhdr
3653 $ i_unistd = tmp
3654 $!
3655 $! Check to see if we've got utime.h (which we should use if we have)
3656 $!
3657 $ i_netdb = "undef"
3658 $ tmp = "utime.h"
3659 $ GOSUB inhdr
3660 $ i_utime = tmp
3661 $!
3662 $! do we have getppid()?
3663 $!
3664 $ IF i_unistd .EQS. "define"
3665 $ THEN
3666 $   OS
3667 $   WS "#include <stdio.h>"
3668 $   WS "#include <unistd.h>"
3669 $   WS "int main() {"
3670 $   WS "printf(""%d\n"",getppid());"
3671 $   WS "return(0);"
3672 $   WS "}"
3673 $   CS
3674 $   tmp = "getppid"
3675 $   GOSUB inlibc
3676 $   d_getppid = tmp
3677 $ ELSE
3678 $   d_getppid = "undef"
3679 $ ENDIF
3680 $!
3681 $!: see if this is a libutil.h system
3682 $!
3683 $ tmp = "libutil.h"
3684 $ GOSUB inhdr
3685 $ i_libutil = tmp
3686 $!
3687 $! Check to see if we've got shadow.h (probably not, but...)
3688 $!
3689 $ tmp = "shadow.h"
3690 $ GOSUB inhdr
3691 $ i_shadow = tmp
3692 $!
3693 $! Check to see if we've got socks.h (probably not, but...)
3694 $!
3695 $ tmp = "socks.h"
3696 $ GOSUB inhdr
3697 $ i_socks = tmp
3698 $!
3699 $! Check the prototype for select
3700 $!
3701 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3702 $ THEN
3703 $   OS
3704 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3705 $   WS "#include <stdlib.h>"
3706 $   WS "#endif"
3707 $   WS "#include <stdio.h>"
3708 $   WS "#include <types.h>"
3709 $   IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3710 $   IF Has_Socketshr
3711 $   THEN
3712 $     WS "#include <socketshr.h>"
3713 $   ELSE
3714 $     WS "#include <time.h>"
3715 $     WS "#include <socket.h>"
3716 $   ENDIF
3717 $   WS "int main()"
3718 $   WS "{"
3719 $   WS "fd_set *foo;"
3720 $   WS "int bar;"
3721 $   WS "foo = NULL;"
3722 $   WS "bar = select(2, foo, foo, foo, NULL);"
3723 $   WS "exit(0);"
3724 $   WS "}"
3725 $   CS
3726 $   GOSUB compile_ok
3727 $   IF compile_status .NE. good_compile
3728 $   THEN
3729 $!   Okay, select failed.  Must be an int *
3730 $     selecttype = "int *"
3731 $     echo4 "select() NOT found."
3732 $   ELSE
3733 $     selecttype="fd_set *"
3734 $     echo4 "select() found."
3735 $   ENDIF
3736 $ ELSE
3737 $   ! No sockets, so stick in an int * : no select, so pick a harmless default
3738 $   selecttype = "int *"
3739 $ ENDIF
3740 $!
3741 $! Check to see if fd_set exists
3742 $!
3743 $ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3744 $ OS
3745 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3746 $ WS "#include <stdlib.h>"
3747 $ WS "#endif"
3748 $ WS "#include <stdio.h>"
3749 $ WS "#include <types.h>"
3750 $ IF Has_Socketshr
3751 $ THEN
3752 $   WS "#include <socketshr.h>"
3753 $ ENDIF
3754 $ IF Has_Dec_C_Sockets
3755 $ THEN
3756 $   WS "#include <time.h>"
3757 $   WS "#include <socket.h>"
3758 $ ENDIF
3759 $ WS "int main()"
3760 $ WS "{"
3761 $ WS "fd_set *foo;"
3762 $ WS "int bar;"
3763 $ WS "exit(0);"
3764 $ WS "}"
3765 $ CS
3766 $ GOSUB compile_ok
3767 $ IF compile_status .ne. good_compile
3768 $ THEN
3769 $!  Okay, fd_set failed. Must not exist
3770 $   d_fd_set = "undef"
3771 $   echo4 "Hmm, your compiler has some difficulty with fd_set."
3772 $ ELSE
3773 $   d_fd_set="define"
3774 $   echo4 "Well, your system knows about the normal fd_set typedef..."
3775 $ ENDIF
3776 $!
3777 $! Check for inttypes.h
3778 $!
3779 $ tmp = "inttypes.h"
3780 $ GOSUB inhdr
3781 $ i_inttypes = tmp
3782 $!
3783 $! Check to see if off64_t exists
3784 $!
3785 $ echo4 "Checking to see if you have off64_t..."
3786 $ OS
3787 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3788 $ WS "#include <stdlib.h>"
3789 $ WS "#endif"
3790 $ WS "#include <stdio.h>"
3791 $ WS "#include <types.h>"
3792 $ WS "#''i_inttypes' IIH"
3793 $ WS "#ifdef IIH"
3794 $ WS "#include <inttypes.h>"
3795 $ WS "#endif"
3796 $ WS "int main()"
3797 $ WS "{"
3798 $ WS "off64_t bar;"
3799 $ WS "exit(0);"
3800 $ WS "}"
3801 $ CS
3802 $ GOSUB compile_ok
3803 $ IF compile_status .EQ. good_compile
3804 $ THEN
3805 $   d_off64_t="define"
3806 $   echo "You have off64_t."
3807 $ ELSE
3808 $   d_off64_t = "undef"
3809 $   echo "You do not have off64_t."
3810 $ ENDIF
3811 $!
3812 $! Check to see if fpos64_t exists
3813 $!
3814 $ echo4 "Checking to see if you have fpos64_t..."
3815 $ OS
3816 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3817 $ WS "#include <stdlib.h>"
3818 $ WS "#endif"
3819 $ WS "#include <stdio.h>"
3820 $ WS "#include <types.h>"
3821 $ WS "#''i_inttypes' IIH"
3822 $ WS "#ifdef IIH"
3823 $ WS "#include <inttypes.h>"
3824 $ WS "#endif"
3825 $ WS "int main()"
3826 $ WS "{"
3827 $ WS "fpos64_t bar;"
3828 $ WS "exit(0);"
3829 $ WS "}"
3830 $ CS
3831 $ GOSUB compile_ok
3832 $ IF compile_status .EQ. good_compile
3833 $ THEN
3834 $   d_fpos64_t="define"
3835 $   echo "You have fpos64_t."
3836 $ ELSE
3837 $   d_fpos64_t = "undef"
3838 $   echo "You do not have fpos64_t."
3839 $ ENDIF
3840 $!
3841 $! Check to see if int64_t exists
3842 $!
3843 $ echo4 "Checking to see if you have int64_t..."
3844 $ OS
3845 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3846 $ WS "#include <stdlib.h>"
3847 $ WS "#endif"
3848 $ WS "#include <stdio.h>"
3849 $ WS "#include <types.h>"
3850 $ WS "#''i_inttypes' IIH"
3851 $ WS "#ifdef IIH"
3852 $ WS "#include <inttypes.h>"
3853 $ WS "#endif"
3854 $ WS "int main()"
3855 $ WS "{"
3856 $ WS "int64_t bar;"
3857 $ WS "exit(0);"
3858 $ WS "}"
3859 $ CS
3860 $ GOSUB compile_ok
3861 $ IF compile_status .EQ. good_compile
3862 $ THEN
3863 $   d_int64_t="define"
3864 $   echo "You have int64_t."
3865 $ ELSE
3866 $   d_int64_t = "undef"
3867 $   echo "You do not have int64_t."
3868 $ ENDIF
3869 $!
3870 $! Check to see if fseeko exists
3871 $!
3872 $ OS
3873 $ WS "#include <stdio.h>"
3874 $ WS "int main()"
3875 $ WS "{"
3876 $ WS "FILE *f=NULL;"
3877 $ WS "fseeko(f,(off_t)0,SEEK_SET);"
3878 $ WS "return(0);"
3879 $ WS "}"
3880 $ CS
3881 $ tmp = "fseeko"
3882 $ GOSUB inlibc
3883 $ d_fseeko = tmp
3884 $!
3885 $! Check to see if ftello exists
3886 $!
3887 $ OS
3888 $ WS "#include <stdio.h>"
3889 $ WS "int main()"
3890 $ WS "{"
3891 $ WS "FILE *f=NULL; off_t o=0;"
3892 $ WS "o=ftello(f);"
3893 $ WS "return(0);"
3894 $ WS "}"
3895 $ CS
3896 $ tmp = "ftello"
3897 $ GOSUB inlibc
3898 $ d_ftello = tmp
3899 $!
3900 $!: see if this is a netdb.h system
3901 $ IF Has_Dec_C_Sockets
3902 $ THEN 
3903 $   tmp = "netdb.h"
3904 $   GOSUB inhdr
3905 $   i_netdb = tmp
3906 $ ENDIF
3907 $!
3908 $! Check for h_errno
3909 $!
3910 $ echo4 "Checking to see if you have h_errno..."
3911 $ OS
3912 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3913 $ WS "#include <stdlib.h>"
3914 $ WS "#endif"
3915 $ WS "#include <stdio.h>"
3916 $ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3917 $ IF i_netdb  .EQS. "define" THEN WS "#include <netdb.h>"
3918 $ WS "int main()"
3919 $ WS "{"
3920 $ WS "h_errno = 3;"
3921 $ WS "exit(0);"
3922 $ WS "}"
3923 $ CS
3924 $ GOSUB link_ok
3925 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3926 $ THEN
3927 $   d_herrno="define"
3928 $   echo "You have h_errno."
3929 $ ELSE
3930 $   d_herrno="undef"
3931 $   echo "You do not have h_errno."
3932 $ ENDIF
3933 $!
3934 $! Check to see if gethostname exists
3935 $!
3936 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3937 $ THEN
3938 $   OS
3939 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3940 $   WS "#include <stdlib.h>"
3941 $   WS "#endif"
3942 $   WS "#include <stdio.h>"
3943 $   WS "#include <types.h>"
3944 $   IF Has_Socketshr
3945 $   THEN
3946 $     WS "#include <socketshr.h>"
3947 $   ELSE
3948 $     WS "#include <time.h>"
3949 $     WS "#include <socket.h>"
3950 $   ENDIF
3951 $   WS "int main()"
3952 $   WS "{"
3953 $   WS "char name[100];"
3954 $   WS "int bar, baz;"
3955 $   WS "bar = 100;"
3956 $   WS "baz = gethostname(name, bar);"
3957 $   WS "exit(0);"
3958 $   WS "}"
3959 $   CS
3960 $   GOSUB link_ok
3961 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3962 $   THEN
3963 $     d_gethname="define"
3964 $     echo4 "gethostname() found."
3965 $   ELSE
3966 $     d_gethname="undef"
3967 $   ENDIF
3968 $ ELSE
3969 $   ! No sockets, so no gethname
3970 $   d_gethname = "undef"
3971 $ ENDIF
3972 $!
3973 $! Check for sys/file.h
3974 $!
3975 $ tmp = "sys/file.h"
3976 $ GOSUB inhdr
3977 $ i_sysfile = tmp
3978 $!
3979 $!
3980 $! Check for sys/ioctl.h
3981 $!
3982 $ tmp = "sys/ioctl.h"
3983 $ GOSUB inhdr
3984 $ i_sysioctl = tmp
3985 $!
3986 $! Check for sys/utsname.h
3987 $!
3988 $ tmp = "sys/utsname.h"
3989 $ GOSUB inhdr
3990 $ i_sysutsname = tmp
3991 $!
3992 $! Check for syslog.h
3993 $!
3994 $ tmp = "syslog.h"
3995 $ GOSUB inhdr
3996 $ i_syslog = tmp
3997 $!
3998 $! Check for poll.h
3999 $!
4000 $ tmp = "poll.h"
4001 $ GOSUB inhdr
4002 $ i_poll = tmp
4003 $!
4004 $! Check for sys/uio.h
4005 $!
4006 $ tmp = "sys/uio.h"
4007 $ GOSUB inhdr
4008 $ i_sysuio = tmp
4009 $!
4010 $! Check for sys/mode.h
4011 $!
4012 $ tmp = "sys/mode.h"
4013 $ GOSUB inhdr
4014 $ i_sysmode = tmp
4015 $!
4016 $! Check for poll.h
4017 $!
4018 $ tmp = "sys/poll.h"
4019 $ gosub inhdr
4020 $ i_syspoll = tmp
4021 $!
4022 $! Check for sys/access.h
4023 $!
4024 $ tmp = "sys/access.h"
4025 $ GOSUB inhdr
4026 $ i_sysaccess = tmp
4027 $!
4028 $! Check for sys/security.h
4029 $!
4030 $ tmp = "sys/security.h"
4031 $ GOSUB inhdr
4032 $ i_syssecrt = tmp
4033 $!
4034 $! Check for fcntl.h
4035 $!
4036 $ tmp = "fcntl.h"
4037 $ GOSUB inhdr
4038 $ i_fcntl = tmp
4039 $!
4040 $! Check for fcntl
4041 $!
4042 $ OS
4043 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4044 $ WS "#include <stdlib.h>"
4045 $ WS "#endif"
4046 $ WS "#include <stdio.h>"
4047 $ WS "#include <fcntl.h>"
4048 $ WS "int main()"
4049 $ WS "{"
4050 $ WS "fcntl(1,2,3);"
4051 $ WS "exit(0);"
4052 $ WS "}"
4053 $ CS
4054 $ tmp = "fcntl"
4055 $ GOSUB inlibc
4056 $ d_fcntl = tmp
4057 $!
4058 $! Check for fcntl locking capability
4059 $!
4060 $ echo4 "Checking if fcntl-based file locking works... "
4061 $ tmp = "undef"
4062 $ IF d_fcntl .EQS. "define"
4063 $ THEN
4064 $   OS
4065 $   WS "#include <stdio.h>"
4066 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4067 $   WS "#include <stdlib.h>"
4068 $   WS "#endif"
4069 $   WS "#include <fcntl.h>"
4070 $   WS "#include <unistd.h>"
4071 $   WS "int main() {"
4072 $   WS "#if defined(F_SETLK) && defined(F_SETLKW)"
4073 $   WS "     struct flock flock;"
4074 $   WS "     int retval, fd;"
4075 $   WS "     fd = open(""[-]perl.c"", O_RDONLY);"
4076 $   WS "     flock.l_type = F_RDLCK;"
4077 $   WS "     flock.l_whence = SEEK_SET;"
4078 $   WS "     flock.l_start = flock.l_len = 0;"
4079 $   WS "     retval = fcntl(fd, F_SETLK, &flock);"
4080 $   WS "     close(fd);"
4081 $   WS "     (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
4082 $   WS "#else"
4083 $   WS "     printf(""undef\n"");"
4084 $   WS "#endif"
4085 $   WS "}"
4086 $   CS
4087 $   GOSUB link_ok
4088 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4089 $   THEN
4090 $     GOSUB just_mcr_it
4091 $     IF tmp .EQS. "define"
4092 $     THEN
4093 $       echo4 "Yes, it seems to work."
4094 $     ELSE
4095 $       echo4 "Nope, it didn't work."
4096 $     ENDIF
4097 $   ELSE
4098 $     echo4 "I'm unable to compile the test program, so I'll assume not."
4099 $     tmp = "undef"
4100 $   ENDIF
4101 $ ELSE
4102 $   echo4 "Nope, since you don't even have fcntl()."
4103 $ ENDIF
4104 $ d_fcntl_can_lock = tmp
4105 $!
4106 $! Check for memchr
4107 $!
4108 $ OS
4109 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4110 $ WS "#include <stdlib.h>"
4111 $ WS "#endif"
4112 $ WS "#include <string.h>"
4113 $ WS "int main()"
4114 $ WS "{"
4115 $ WS "char * place;"
4116 $ WS "place = memchr(""foo"", 47, 3);"
4117 $ WS "exit(0);"
4118 $ WS "}"
4119 $ CS
4120 $ tmp = "memchr"
4121 $ GOSUB inlibc
4122 $ d_memchr = tmp
4123 $!
4124 $! Check for strtoull
4125 $!
4126 $ OS
4127 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4128 $ WS "#include <stdlib.h>"
4129 $ WS "#endif"
4130 $ WS "#include <string.h>"
4131 $ WS "int main()"
4132 $ WS "{"
4133 $ WS "unsigned __int64 result;"
4134 $ WS "result = strtoull(""123123"", NULL, 10);"
4135 $ WS "exit(0);"
4136 $ WS "}"
4137 $ CS
4138 $ tmp = "strtoull"
4139 $ GOSUB inlibc
4140 $ d_strtoull = tmp
4141 $!
4142 $! Check for strtouq
4143 $!
4144 $ OS
4145 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4146 $ WS "#include <stdlib.h>"
4147 $ WS "#endif"
4148 $ WS "#include <string.h>"
4149 $ WS "int main()"
4150 $ WS "{"
4151 $ WS "unsigned __int64 result;"
4152 $ WS "result = strtouq(""123123"", NULL, 10);"
4153 $ WS "exit(0);"
4154 $ WS "}"
4155 $ CS
4156 $ tmp = "strtouq"
4157 $ GOSUB inlibc
4158 $ d_strtouq = tmp
4159 $!
4160 $! Check for strtoll
4161 $!
4162 $ OS
4163 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4164 $ WS "#include <stdlib.h>"
4165 $ WS "#endif"
4166 $ WS "#include <string.h>"
4167 $ WS "int main()"
4168 $ WS "{"
4169 $ WS "__int64 result;"
4170 $ WS "result = strtoll(""123123"", NULL, 10);"
4171 $ WS "exit(0);"
4172 $ WS "}"
4173 $ CS
4174 $ tmp = "strtoll"
4175 $ GOSUB inlibc
4176 $ d_strtoll = tmp
4177 $!
4178 $! Check for strtoq
4179 $!
4180 $ OS
4181 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4182 $ WS "#include <stdlib.h>"
4183 $ WS "#endif"
4184 $ WS "#include <string.h>"
4185 $ WS "int main()"
4186 $ WS "{"
4187 $ WS "__int64 result;"
4188 $ WS "result = strtoq(""123123"", NULL, 10);"
4189 $ WS "exit(0);"
4190 $ WS "}"
4191 $ CS
4192 $ tmp = "strtoq"
4193 $ GOSUB inlibc
4194 $ d_strtoq = tmp
4195 $!
4196 $! Check for strtold
4197 $!
4198 $ OS
4199 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4200 $ WS "#include <stdlib.h>"
4201 $ WS "#endif"
4202 $ WS "#include <string.h>"
4203 $ WS "int main()"
4204 $ WS "{"
4205 $ WS "long double result;"
4206 $ WS "result = strtold(""123123"", NULL, 10);"
4207 $ WS "exit(0);"
4208 $ WS "}"
4209 $ CS
4210 $ tmp = "strtold"
4211 $ GOSUB inlibc
4212 $ d_strtold = tmp
4213 $!
4214 $! Check for atoll
4215 $!
4216 $ OS
4217 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4218 $ WS "#include <stdlib.h>"
4219 $ WS "#endif"
4220 $ WS "#include <string.h>"
4221 $ WS "int main()"
4222 $ WS "{"
4223 $ WS " __int64 result;"
4224 $ WS "result = atoll(""123123"");"
4225 $ WS "exit(0);"
4226 $ WS "}"
4227 $ CS
4228 $ tmp = "atoll"
4229 $ GOSUB inlibc
4230 $ d_atoll = tmp
4231 $!
4232 $! Check for atolf
4233 $!
4234 $ OS
4235 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4236 $ WS "#include <stdlib.h>"
4237 $ WS "#endif"
4238 $ WS "#include <string.h>"
4239 $ WS "int main()"
4240 $ WS "{"
4241 $ WS "long double"
4242 $ WS "result = atolf(""123123"");"
4243 $ WS "exit(0);"
4244 $ WS "}"
4245 $ CS
4246 $ tmp = "atolf"
4247 $ GOSUB inlibc
4248 $ d_atolf = tmp
4249 $!
4250 $! Check for access
4251 $!
4252 $ OS
4253 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4254 $ WS "#include <stdlib.h>"
4255 $ WS "#endif"
4256 $ WS "#include <stdio.h>"
4257 $ WS "int main()"
4258 $ WS "{"
4259 $ WS "access(""foo"", F_OK);"
4260 $ WS "exit(0);"
4261 $ WS "}"
4262 $ CS
4263 $ tmp = "acess"
4264 $ GOSUB inlibc
4265 $ d_access = tmp
4266 $!
4267 $! Check for bzero
4268 $!
4269 $ OS
4270 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4271 $ WS "#include <stdlib.h>"
4272 $ WS "#endif"
4273 $ WS "#include <stdio.h>"
4274 $ WS "#include <strings.h>"
4275 $ WS "int main()"
4276 $ WS "{"
4277 $ WS "char foo[10];"
4278 $ WS "bzero(foo, 10);"
4279 $ WS "exit(0);"
4280 $ WS "}"
4281 $ CS
4282 $ tmp = "bzero"
4283 $ GOSUB inlibc
4284 $ d_bzero = tmp
4285 $!
4286 $! Check for bcopy
4287 $!
4288 $ OS
4289 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4290 $ WS "#include <stdlib.h>"
4291 $ WS "#endif"
4292 $ WS "#include <stdio.h>"
4293 $ WS "#include <strings.h>"
4294 $ WS "int main()"
4295 $ WS "{"
4296 $ WS "char foo[10], bar[10];"
4297 $ WS "bcopy(""foo"", bar, 3);"
4298 $ WS "exit(0);"
4299 $ WS "}"
4300 $ CS
4301 $ tmp = "bcopy"
4302 $ GOSUB inlibc
4303 $ d_bcopy = tmp
4304 $!
4305 $! Check for mkstemp
4306 $!
4307 $ OS
4308 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4309 $ WS "#include <stdlib.h>"
4310 $ WS "#endif"
4311 $ WS "#include <stdio.h>"
4312 $ WS "int main()"
4313 $ WS "{"
4314 $ WS "mkstemp(""foo"");"
4315 $ WS "exit(0);"
4316 $ WS "}"
4317 $ CS
4318 $ tmp = "mkstemp"
4319 $ GOSUB inlibc
4320 $ d_mkstemp = tmp
4321 $!
4322 $! Check for mkstemps
4323 $!
4324 $ OS
4325 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4326 $ WS "#include <stdlib.h>"
4327 $ WS "#endif"
4328 $ WS "#include <stdio.h>"
4329 $ WS "int main()"
4330 $ WS "{"
4331 $ WS "mkstemps(""foo"", 1);"
4332 $ WS "exit(0);"
4333 $ WS "}"
4334 $ CS
4335 $ tmp = "mkstemps"
4336 $ GOSUB inlibc
4337 $ d_mkstemps = tmp
4338 $!
4339 $! Check for mkdtemp
4340 $!
4341 $ OS
4342 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4343 $ WS "#include <stdlib.h>"
4344 $ WS "#endif"
4345 $ WS "#include <stdio.h>"
4346 $ WS "int main()"
4347 $ WS "{"
4348 $ WS "mkdtemp(""foo"");"
4349 $ WS "exit(0);"
4350 $ WS "}"
4351 $ CS
4352 $ tmp = "mkdtemp"
4353 $ GOSUB inlibc
4354 $ d_mkdtemp = tmp
4355 $!
4356 $! Check for poll
4357 $!
4358 $ if i_poll .eqs. "define"
4359 $ then
4360 $   OS
4361 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4362 $   WS "#include <stdlib.h>"
4363 $   WS "#endif"
4364 $   WS "#include <poll.h>"
4365 $   WS "int main()"
4366 $   WS "{"
4367 $   WS "struct pollfd pfd;"
4368 $   WS "int count=poll(&pfd,1,0);"
4369 $   WS "exit(0);"
4370 $   WS "}"
4371 $   CS
4372 $   tmp = "poll"
4373 $   GOSUB inlibc
4374 $   d_poll = tmp
4375 $ else
4376 $   d_poll = "undef"
4377 $ endif
4378 $!
4379 $! Check for setvbuf
4380 $!
4381 $ OS
4382 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4383 $ WS "#include <stdlib.h>"
4384 $ WS "#endif"
4385 $ WS "#include <stdio.h>"
4386 $ WS "int main()"
4387 $ WS "{"
4388 $ WS "FILE *foo;"
4389 $ WS "char Buffer[99];"
4390 $ WS "foo = fopen(""foo"", ""r"");"
4391 $ WS "setvbuf(foo, Buffer, 0, 0);"
4392 $ WS "exit(0);"
4393 $ WS "}"
4394 $ CS
4395 $ tmp = "setvbuf"
4396 $ GOSUB inlibc
4397 $ d_setvbuf = tmp
4398 $!
4399 $! see if sfio.h is available
4400 $! see if sfio library is available
4401 $! Ok, but do we want to use it.
4402 $! IF F$TYPE(usesfio) .EQS. "" THEN usesfio = "undef"
4403 $! IF val .EQS. "define"
4404 $! THEN
4405 $!   IF usesfio .EQS. "define"
4406 $!   THEN dflt = "y"
4407 $!   ELSE dflt = "n"
4408 $!   ENDIF
4409 $!   echo "''package' can use the sfio library, but it is experimental."
4410 $!   IF useperlio .EQS. "undef"
4411 $!   THEN
4412 $!     echo "For sfio also the PerlIO abstraction layer is needed."
4413 $!     echo "Earlier you said you would not want that."
4414 $!   ENDIF
4415 $!   rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
4416 $!   GOSUB myread
4417 $!   IF ans .EQS. "" THEN ans = dflt
4418 $!   IF ans
4419 $!   THEN
4420 $!     echo "Ok, turning on both sfio and PerlIO, then."
4421 $!     useperlio="define"
4422 $!     val="define"
4423 $!   ELSE
4424 $!     echo "Ok, avoiding sfio this time.  I'll use stdio instead."
4425 $!     val="undef"
4426 $!   ENDIF
4427 $! ELSE
4428 $!   IF usesfio .EQS. "define"
4429 $!   THEN
4430 $!     echo4 "Sorry, cannot find sfio on this machine."
4431 $!     echo4 "Ignoring your setting of usesfio=''usesfio'."
4432 $!     val="undef"
4433 $!   ENDIF
4434 $! ENDIF
4435 $!
4436 $! Check for setenv
4437 $!
4438 $ OS
4439 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4440 $ WS "#include <stdlib.h>"
4441 $ WS "#endif"
4442 $ WS "#include <stdio.h>"
4443 $ WS "int main()"
4444 $ WS "{"
4445 $ WS "setenv(""FOO"", ""BAR"", 0);"
4446 $ WS "exit(0);"
4447 $ WS "}"
4448 $ CS
4449 $ tmp = "setenv"
4450 $ GOSUB inlibc
4451 $ d_setenv = tmp
4452 $!
4453 $! Check for setproctitle
4454 $!
4455 $ OS
4456 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4457 $ WS "#include <stdlib.h>"
4458 $ WS "#endif"
4459 $ WS "#include <stdio.h>"
4460 $ WS "int main()"
4461 $ WS "{"
4462 $ WS "setproctitle(""%s"", ""FOO"");"
4463 $ WS "exit(0);"
4464 $ WS "}"
4465 $ CS
4466 $ tmp = "setproctitle"
4467 $ GOSUB inlibc
4468 $ d_setproctitle = tmp
4469 $!
4470 $! Check for <netinet/in.h>
4471 $!
4472 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4473 $ THEN
4474 $   tmp = "netinet/in.h"
4475 $   GOSUB inhdr
4476 $   i_niin = tmp
4477 $ ELSE
4478 $   i_niin="undef"
4479 $ ENDIF
4480 $!
4481 $! Check for <netinet/tcp.h>
4482 $!
4483 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4484 $ THEN
4485 $   tmp = "netinet/tcp.h"
4486 $   GOSUB inhdr
4487 $   i_netinettcp = tmp
4488 $ ELSE
4489 $   i_netinettcp="undef"
4490 $ ENDIF
4491 $!
4492 $! Check for endhostent
4493 $!
4494 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4495 $ THEN
4496 $   OS
4497 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4498 $   WS "#include <stdlib.h>"
4499 $   WS "#endif"
4500 $   WS "#include <stdio.h>"
4501 $   IF Has_Socketshr
4502 $   THEN WS "#include <socketshr.h>"
4503 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4504 $   ENDIF
4505 $   WS "int main()"
4506 $   WS "{"
4507 $   WS "endhostent();"
4508 $   WS "exit(0);"
4509 $   WS "}"
4510 $   CS
4511 $   tmp = "endhostent"
4512 $   GOSUB inlibc
4513 $   d_endhent = tmp
4514 $ ELSE
4515 $   d_endhent="undef"
4516 $ ENDIF
4517 $!
4518 $! Check for endnetent
4519 $!
4520 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
4521 $ THEN
4522 $   OS
4523 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4524 $   WS "#include <stdlib.h>"
4525 $   WS "#endif"
4526 $   WS "#include <stdio.h>"
4527 $   IF Has_Socketshr
4528 $   THEN WS "#include <socketshr.h>"
4529 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4530 $   ENDIF
4531 $   WS "int main()"
4532 $   WS "{"
4533 $   WS "endnetent();"
4534 $   WS "exit(0);"
4535 $   WS "}"
4536 $   CS
4537 $   tmp = "endnetent"
4538 $   GOSUB inlibc
4539 $   d_endnent = tmp
4540 $ ELSE
4541 $   d_endnent="undef"
4542 $ ENDIF
4543 $!
4544 $! Check for endprotoent
4545 $!
4546 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4547 $ THEN
4548 $   OS
4549 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4550 $   WS "#include <stdlib.h>"
4551 $   WS "#endif"
4552 $   WS "#include <stdio.h>"
4553 $   IF Has_Socketshr
4554 $   THEN WS "#include <socketshr.h>"
4555 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4556 $   ENDIF
4557 $   WS "int main()"
4558 $   WS "{"
4559 $   WS "endprotoent();"
4560 $   WS "exit(0);"
4561 $   WS "}"
4562 $   CS
4563 $   tmp = "endprotoent"
4564 $   GOSUB inlibc
4565 $   d_endpent = tmp
4566 $ ELSE
4567 $   d_endpent="undef"
4568 $ ENDIF
4569 $!
4570 $! Check for endservent
4571 $!
4572 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4573 $ THEN
4574 $   OS
4575 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4576 $   WS "#include <stdlib.h>"
4577 $   WS "#endif"
4578 $   WS "#include <stdio.h>"
4579 $   IF Has_Socketshr
4580 $   THEN WS "#include <socketshr.h>"
4581 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4582 $   ENDIF
4583 $   WS "int main()"
4584 $   WS "{"
4585 $   WS "endservent();"
4586 $   WS "exit(0);"
4587 $   WS "}"
4588 $   CS
4589 $   tmp = "endservent"
4590 $   GOSUB inlibc
4591 $   d_endsent = tmp
4592 $ ELSE
4593 $   d_endsent="undef"
4594 $ ENDIF
4595 $!
4596 $! Check for sethostent
4597 $!
4598 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4599 $ THEN
4600 $   OS
4601 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4602 $   WS "#include <stdlib.h>"
4603 $   WS "#endif"
4604 $   WS "#include <stdio.h>"
4605 $   IF Has_Socketshr
4606 $   THEN WS "#include <socketshr.h>"
4607 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4608 $   ENDIF
4609 $   WS "int main()"
4610 $   WS "{"
4611 $   WS "sethostent(1);"
4612 $   WS "exit(0);"
4613 $   WS "}"
4614 $   CS
4615 $   tmp = "sethostent"
4616 $   GOSUB inlibc
4617 $   d_sethent = tmp
4618 $ ELSE
4619 $   d_sethent="undef"
4620 $ ENDIF
4621 $!
4622 $! Check for setnetent
4623 $!
4624 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4625 $ THEN
4626 $   OS
4627 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4628 $   WS "#include <stdlib.h>"
4629 $   WS "#endif"
4630 $   WS "#include <stdio.h>"
4631 $   IF Has_Socketshr
4632 $   THEN WS "#include <socketshr.h>"
4633 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4634 $   ENDIF
4635 $   WS "int main()"
4636 $   WS "{"
4637 $   WS "setnetent(1);"
4638 $   WS "exit(0);"
4639 $   WS "}"
4640 $   CS
4641 $   tmp = "setnetent"
4642 $   GOSUB inlibc
4643 $   d_setnent = tmp
4644 $ ELSE
4645 $   d_setnent="undef"
4646 $ ENDIF
4647 $!
4648 $! Check for setprotoent
4649 $!
4650 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4651 $ THEN
4652 $   OS
4653 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4654 $   WS "#include <stdlib.h>"
4655 $   WS "#endif"
4656 $   WS "#include <stdio.h>"
4657 $   IF Has_Socketshr
4658 $   THEN WS "#include <socketshr.h>"
4659 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4660 $   ENDIF
4661 $   WS "int main()"
4662 $   WS "{"
4663 $   WS "setprotoent(1);"
4664 $   WS "exit(0);"
4665 $   WS "}"
4666 $   CS
4667 $   tmp = "setprotoent"
4668 $   GOSUB inlibc
4669 $   d_setpent = tmp
4670 $ ELSE
4671 $   d_setpent="undef"
4672 $ ENDIF
4673 $!
4674 $! Check for setservent
4675 $!
4676 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4677 $ THEN
4678 $   OS
4679 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4680 $   WS "#include <stdlib.h>"
4681 $   WS "#endif"
4682 $   WS "#include <stdio.h>"
4683 $   IF Has_Socketshr
4684 $   THEN WS "#include <socketshr.h>"
4685 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4686 $   ENDIF
4687 $   WS "int main()"
4688 $   WS "{"
4689 $   WS "setservent(1);"
4690 $   WS "exit(0);"
4691 $   WS "}"
4692 $   CS
4693 $   tmp = "setservent"
4694 $   GOSUB inlibc
4695 $   d_setsent = tmp
4696 $ ELSE
4697 $   d_setsent="undef"
4698 $ ENDIF
4699 $!
4700 $! Check for gethostent
4701 $!
4702 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4703 $ THEN
4704 $   OS
4705 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4706 $   WS "#include <stdlib.h>"
4707 $   WS "#endif"
4708 $   WS "#include <stdio.h>"
4709 $   IF Has_Socketshr
4710 $   THEN WS "#include <socketshr.h>"
4711 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4712 $   ENDIF
4713 $   WS "int main()"
4714 $   WS "{"
4715 $   WS "gethostent();"
4716 $   WS "exit(0);"
4717 $   WS "}"
4718 $   CS
4719 $   tmp = "gethostent"
4720 $   GOSUB inlibc
4721 $   d_gethent = tmp
4722 $ ELSE
4723 $   d_gethent="undef"
4724 $ ENDIF
4725 $!
4726 $! Check for getnetent
4727 $!
4728 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4729 $ THEN
4730 $   OS
4731 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4732 $   WS "#include <stdlib.h>"
4733 $   WS "#endif"
4734 $   WS "#include <stdio.h>"
4735 $   IF Has_Socketshr
4736 $   THEN WS "#include <socketshr.h>"
4737 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4738 $   ENDIF
4739 $   WS "int main()"
4740 $   WS "{"
4741 $   WS "getnetent();"
4742 $   WS "exit(0);"
4743 $   WS "}"
4744 $   CS
4745 $   tmp = "getnetent"
4746 $   GOSUB inlibc
4747 $   d_getnent = tmp
4748 $ ELSE
4749 $   d_getnent="undef"
4750 $ ENDIF
4751 $!
4752 $! Check for getprotoent
4753 $!
4754 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4755 $ THEN
4756 $   OS
4757 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4758 $   WS "#include <stdlib.h>"
4759 $   WS "#endif"
4760 $   WS "#include <stdio.h>"
4761 $   IF Has_Socketshr
4762 $   THEN WS "#include <socketshr.h>"
4763 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4764 $   ENDIF
4765 $   WS "int main()"
4766 $   WS "{"
4767 $   WS "getprotoent();"
4768 $   WS "exit(0);"
4769 $   WS "}"
4770 $   CS
4771 $   tmp = "getprotoent"
4772 $   GOSUB inlibc
4773 $   d_getpent = tmp
4774 $ ELSE
4775 $   d_getpent="undef"
4776 $ ENDIF
4777 $!
4778 $! Check for getservent
4779 $!
4780 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4781 $ THEN
4782 $   OS
4783 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4784 $   WS "#include <stdlib.h>"
4785 $   WS "#endif"
4786 $   WS "#include <stdio.h>"
4787 $   IF Has_Socketshr
4788 $   THEN WS "#include <socketshr.h>"
4789 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4790 $   ENDIF
4791 $   WS "int main()"
4792 $   WS "{"
4793 $   WS "getservent();"
4794 $   WS "exit(0);"
4795 $   WS "}"
4796 $   CS
4797 $   tmp = "getservent"
4798 $   GOSUB inlibc
4799 $   d_getsent = tmp
4800 $ ELSE
4801 $   d_getsent="undef"
4802 $ ENDIF
4803 $!
4804 $! Check for nanosleep
4805 $!
4806 $ OS
4807 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4808 $ WS "#include <stdlib.h>"
4809 $ WS "#endif"
4810 $ WS "#include <time.h>"
4811 $ WS "int main()"
4812 $ WS "{"
4813 $ WS "int asleep = nanosleep(NULL,NULL);"
4814 $ WS "exit(0);"
4815 $ WS "}"
4816 $ CS
4817 $ tmp = "nanosleep"
4818 $ GOSUB inlibc
4819 $ d_nanosleep = tmp
4820 $!
4821 $! Check for socklen_t
4822 $!
4823 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4824 $ THEN
4825 $   echo4 "Checking to see if you have socklen_t..."
4826 $   OS
4827 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4828 $   WS "#include <stdlib.h>"
4829 $   WS "#endif"
4830 $   WS "#include <stdio.h>"
4831 $   IF Has_Socketshr
4832 $   THEN WS "#include <socketshr.h>"
4833 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4834 $   ENDIF
4835 $   WS "int main()"
4836 $   WS "{"
4837 $   WS "socklen_t x = 16;"
4838 $   WS "exit(0);"
4839 $   WS "}"
4840 $   CS
4841 $   GOSUB link_ok
4842 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4843 $   THEN
4844 $     d_socklen_t="define"
4845 $     echo "You have socklen_t."
4846 $   ELSE
4847 $     d_socklen_t="undef"
4848 $     echo "You do not have socklen_t."
4849 $   ENDIF
4850 $ ELSE
4851 $   d_socklen_t="undef"
4852 $ ENDIF
4853 $!
4854 $! Check for pthread_yield
4855 $!
4856 $ IF use_threads
4857 $ THEN
4858 $   OS
4859 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4860 $   WS "#include <stdlib.h>"
4861 $   WS "#endif"
4862 $   WS "#include <pthread.h>"
4863 $   WS "#include <stdio.h>"
4864 $   WS "int main()"
4865 $   WS "{"
4866 $   WS "pthread_yield();"
4867 $   WS "exit(0);"
4868 $   WS "}"
4869 $   CS
4870 $   tmp = "pthread_yield"
4871 $   GOSUB inlibc
4872 $   d_pthread_yield = tmp
4873 $ ELSE
4874 $   d_pthread_yield="undef"
4875 $ ENDIF
4876 $!
4877 $! Check for sched_yield
4878 $!
4879 $ IF use_threads
4880 $ THEN
4881 $   OS
4882 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4883 $   WS "#include <stdlib.h>"
4884 $   WS "#endif"
4885 $   WS "#include <pthread.h>"
4886 $   WS "#include <stdio.h>"
4887 $   WS "int main()"
4888 $   WS "{"
4889 $   WS "sched_yield();"
4890 $   WS "exit(0);"
4891 $   WS "}"
4892 $   CS
4893 $   tmp = "sched_yield"
4894 $   GOSUB inlibc
4895 $   d_sched_yield = tmp
4896 $   IF d_sched_yield .EQS. "define"
4897 $   THEN sched_yield = "sched_yield"
4898 $   ELSE sched_yield = " "
4899 $   ENDIF
4900 $ ELSE
4901 $   d_sched_yield="undef"
4902 $   sched_yield = " "
4903 $ ENDIF
4904 $!
4905 $! Check for pthread_attr_setscope and PTHREAD_SCOPE_SYSTEM.
4906 $! (The actual test is to be written.)
4907 $!
4908 $ d_pthread_attr_setscope="undef"
4909 $!
4910 $! Check for generic pointer size
4911 $!
4912 $ echo4 "Checking to see how big your pointers are..." 
4913 $ OS
4914 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4915 $ WS "#include <stdlib.h>"
4916 $ WS "#endif"
4917 $ WS "#include <stdio.h>"
4918 $ WS "int main()"
4919 $ WS "{"
4920 $ WS "int foo;"
4921 $ WS "foo = sizeof(char *);"
4922 $ WS "printf(""%d\n"", foo);"
4923 $ WS "exit(0);"
4924 $ WS "}"
4925 $ CS
4926 $ tmp = "char *"
4927 $ GOSUB type_size_check
4928 $ ptrsize = tmp
4929 $ echo "Your pointers are ''ptrsize' bytes long."
4930 $!
4931 $! Check for size_t size
4932 $!
4933 $ tmp = "size_t"
4934 $ zzz = tmp
4935 $ echo4 "Checking the size of ''zzz'..."
4936 $ GOSUB type_size_check
4937 $ sizesize = tmp
4938 $ echo "Your ''zzz' size is ''sizesize' bytes."
4939 $!
4940 $! Check for _LARGEFILE capability.
4941 $!
4942 $ off_t_size = 4
4943 $ OS
4944 $ WS "#define _LARGEFILE"
4945 $ WS "#include <stdio.h>"
4946 $ WS "int main()"
4947 $ WS "{"
4948 $ WS "printf(""%d\n"", sizeof(off_t));"
4949 $ WS "return(0);"
4950 $ WS "}"
4951 $ CS
4952 $ GOSUB link_ok
4953 $ IF link_status .EQ. good_link
4954 $ THEN
4955 $   GOSUB just_mcr_it
4956 $   off_t_size = tmp
4957 $ ENDIF
4958 $ echo "Your off_t size is ''off_t_size' bytes when _LARGEFILE is defined."
4959 $ IF off_t_size .ne. 8 .AND. (uselargefiles .OR. uselargefiles .eqs. "define")
4960 $ THEN
4961 $   echo4 "You configured with -Duselargefiles but your CRTL does not support _LARGEFILE."
4962 $   echo4 "I'm disabling large file support."
4963 $   uselargefiles = "undef"
4964 $ ENDIF
4965 $!
4966 $! Tests for hard link, symbolic links, and 7.3 + CRTL features
4967 $!
4968 $  d_lchown = "undef"
4969 $  d_link = "undef"
4970 $  d_lstat = "undef"
4971 $  d_readlink = "undef"
4972 $  d_symlink = "undef"
4973 $  d_realpath = "undef"
4974 $!
4975 $! Hard link support has been present since 7.3-1 except for the
4976 $! easy to use DCL test to see if hardlinks are enabled on the build
4977 $! disk.  That would require more work to test, and I am only testing
4978 $! this on 8.2, so that is why the 8.2 test.
4979 $!
4980 $  IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
4981 $  THEN
4982 $   IF f$getdvi("SYS$DISK","HARDLINKS_SUPPORTED")
4983 $   THEN
4984 $       echo "I Found 64 bit OpenVMS 8.2 or later, and hard links enabled on build disk."
4985 $       echo "I will build with hard link support"
4986 $       d_link = "define"
4987 $   ELSE
4988 $       echo "I Found 64 bit OpenVMS 8.2 or later, and hard links disabled on build disk."
4989 $       echo "I will not build with hard link support."
4990 $   ENDIF
4991 $  ELSE
4992 $    echo4 "I can not detect if your CRTL and build disk support hard links."
4993 $    echo4 "I am disabling hard link support."
4994 $  ENDIF
4995 $!
4996 $  IF uselargefiles .OR. uselargefiles .eqs. "define"
4997 $  THEN
4998 $    IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
4999 $    THEN
5000 $      echo4 "Largefile support enabled, so enabling standard stat support too."
5001 $      usestdstat = "y"
5002 $      echo4 -
5003    "Looking for the realpath() function to indicate symbolic link support..."
5004 $      OS
5005 $!      WS "#include <stdlib.h>"
5006 $      WS "void exit(int foo);"
5007 $      WS "char *realpath(const char *file_name, char * resolved_name, ...);"
5008 $      WS "int main()"
5009 $      WS "{"
5010 $      WS "char result[255];"
5011 $      WS "realpath(""foo"",result);"
5012 $      WS "exit(0);"
5013 $      WS "}"
5014 $      CS
5015 $      GOSUB link_ok
5016 $      IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5017 $      THEN
5018 $        echo -
5019            "Found realpath() which indicates symbolic link support is present."
5020 $        d_lchown = "define"
5021 $        d_lstat = "define"
5022 $        d_readlink = "define"
5023 $        d_symlink = "define"
5024 $!       d_realpath = "define" ! Perl will not put it in the config.h file?
5025 $!      Perl apparently does not use a built in realpath() on other platforms,
5026 $!      but there is a severe performance penatly on OpenVMS to use the Perl
5027 $!      script that implements a realpath().  The d_symlink symbol is used
5028 $!      as a replacement for the d_realpath since they are related and both
5029 $!      were activated by the CRTL at the same time.
5030 $!
5031 $        ELSE
5032 $         echo4 "Your system does not support symbolic links."
5033 $         echo4 "I am disabling symbolic link support."
5034 $       ENDIF
5035 $    ELSE
5036 $       echo4 "Your system does not support symbolic links."
5037 $       echo4 "I am disabling symbolic link support."
5038 $    ENDIF
5039 $  ELSE
5040 $    IF (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
5041 $    THEN
5042 $       echo4 "-Duselargefiles is required for symbolic link support."
5043 $       echo4 "You did not specify that, so I am disabling symbolic link support."
5044 $    ENDIF
5045 $  ENDIF
5046 $!
5047 $!
5048 $! Check for grp.h -- should be 7.3 and later, but test to be sure
5049 $!
5050 $ tmp = "grp.h"
5051 $ GOSUB inhdr
5052 $ i_grp = tmp
5053 $!
5054 $! VMS V7.3-2 powered options
5055 $! We know that it is only available for V7.3-2 and later on 64 bit platforms.
5056 $!
5057 $  d_getgrgid_r = "undef"
5058 $  getgrgid_r_proto = "0"
5059 $  d_getgrnam_r = "undef"
5060 $  getgrnam_r_proto = "0"
5061 $  d_getpgid = "undef"
5062 $  d_getpgrp = "undef"
5063 $! N.B.  We already have home-grown thread-safe versions of
5064 $!       getpwnam and getpwuid -- no need to use CRTL versions
5065 $  d_getpwnam_r = "undef"
5066 $  getpwnam_r_proto = "0"
5067 $  d_getpwuid_r = "undef"
5068 $  getpwuid_r_proto = "0"
5069 $  d_setgrent = "undef"
5070 $  d_ttyname_r = "undef"
5071 $  ttyname_r_proto = "0"
5072 $  d_snprintf = "undef"
5073 $  d_vsnprintf = "undef"
5074 $  if (vms_ver .GES. "7.3-2") .AND. (archname .NES. "VMS_VAX")
5075 $  then
5076 $    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 routines"
5077 $    d_getgrgid_r = "define"
5078 $    getgrgid_r_proto = "1"
5079 $    d_getgrnam_r = "define"
5080 $    getgrnam_r_proto = "1"
5081 $    if d_symlink .or. d_symlink .EQS. "define"
5082 $    then
5083 $!       FIXME: Need to find how to activate this.
5084 $!       d_getpgid = "define"
5085 $!       d_getpgrp = "define"
5086 $    endif
5087 $    d_setgrent = "define"
5088 $    d_ttyname_r = "define"
5089 $    ttyname_r_proto = "1"
5090 $    d_snprintf = "define"
5091 $    d_vsnprintf = "define"
5092 $  endif
5093 $!
5094 $! VMS V7.3-2 powered options
5095 $! We know that it is only available for V7.3-2 and later on 64 bit platforms.
5096 $! Only implementing right now on 8.2 because that is what I am testing
5097 $! These functions may require POSIX UIDs/GIDs to be active, so I am
5098 $! not activating the features at this time, just preparing this file
5099 $! to easily use them in the future.
5100 $!
5101 $  d_seteuid = "undef"
5102 $  d_setpgid = "undef"
5103 $  d_setpgrp = "undef"
5104 $  d_setregid = "undef"
5105 $  d_setreuid = "undef"
5106 $  d_setsid = "undef"
5107 $  ! Disable this section for now.
5108 $!$  if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
5109 $  if .NOT. 1
5110 $  then
5111 $    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 UID setting routines"
5112 $    d_seteuid = "define"
5113 $    d_setpgid = "define"
5114 $    d_setpgrp = "define"
5115 $    d_setregid = "define"
5116 $    d_setreuid = "define"
5117 $    d_setsid = "define"
5118 $  endif
5119 $!
5120 $! VMS V8 powered options
5121 $! We know that it is only available for 8.2 and later on 64 bit platforms.
5122 $!
5123 $  d_fstatvfs = "undef"
5124 $!  d_statvfs = "undef"
5125 $  i_sysstatvfs = "undef"
5126 $  if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
5127 $  then
5128 $    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with 8.2 routines"
5129 $    d_fstatvfs = "define"
5130 $!    d_statvfs = "define"
5131 $    i_sysstatvfs = "define"
5132 $  endif
5133 $!
5134 $! Check rand48 and its ilk
5135 $!
5136 $ echo4 "Looking for a random number function..."
5137 $ OS
5138 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5139 $ WS "#include <stdlib.h>"
5140 $ WS "#endif"
5141 $ WS "#include <stdio.h>"
5142 $ WS "int main()"
5143 $ WS "{"
5144 $ WS "srand48(12L);"
5145 $ WS "exit(0);"
5146 $ WS "}"
5147 $ CS
5148 $ GOSUB link_ok
5149 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5150 $ THEN
5151 $   drand01 = "drand48()"
5152 $   randbits = "48"
5153 $   randfunc = "drand48"
5154 $   randseedtype = "long int"
5155 $   seedfunc = "srand48"
5156 $   echo4 "Good, found drand48()."
5157 $   d_drand48proto = "define"
5158 $ ELSE
5159 $   d_drand48proto = "undef"
5160 $   drand01="random()"
5161 $   randbits = "31"
5162 $   randfunc = "random"
5163 $   randseedtype = "unsigned"
5164 $   seedfunc = "srandom"
5165 $   OS
5166 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5167 $   WS "#include <stdlib.h>"
5168 $   WS "#endif"
5169 $   WS "#include <stdio.h>"
5170 $   WS "int main()"
5171 $   WS "{"
5172 $   WS "srandom(12);"
5173 $   WS "exit(0);"
5174 $   WS "}"
5175 $   CS
5176 $   GOSUB link_ok
5177 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5178 $   THEN
5179 $     echo4 "OK, found random()."
5180 $   ELSE
5181 $     drand01="(((float)rand())*MY_INV_RAND_MAX)"
5182 $     randfunc = "rand"
5183 $     randseedtype = "unsigned"
5184 $     seedfunc = "srand"
5185 $     echo4 "Yick, looks like I have to use rand()."
5186 $   ENDIF
5187 $ ENDIF
5188 $! Done with compiler checks. Clean up.
5189 $ IF F$SEARCH("try.c")  .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
5190 $ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
5191 $ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
5192 $ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
5193 $ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
5194 $ IF ccname .EQS. "CXX"
5195 $ THEN
5196 $   CALL Cxx_demangler_cleanup
5197 $ ENDIF
5198 $!
5199 $! Some that are compiler or VMS version sensitive
5200 $!
5201 $! Gnu C stuff
5202 $ IF ccname .EQS. "GCC"
5203 $ THEN
5204 $   d_attribut="define"
5205 $   vms_cc_type="gcc"
5206 $ ELSE
5207 $   vms_cc_type="cc"
5208 $   d_attribut="undef"
5209 $ ENDIF
5210 $!
5211 $! Dec C >= 5.2 and VMS ver >= 7.0
5212 $ IF (ccname .EQS. "DEC") .AND. -
5213      (F$INTEGER(Dec_C_Version).GE.50200000) .AND. (vms_ver .GES. "7.0")
5214 $ THEN
5215 $   d_bcmp="define"
5216 $   d_getitimer="define"
5217 $   d_gettimeod="define"
5218 $   d_mmap="define"
5219 $   d_mprotect="define"
5220 $   d_munmap="define"
5221 $   d_msync="define"
5222 $   d_ualarm="define"
5223 $   d_uname="define"
5224 $!   d_unsetenv="define" ! Fix me - Activating requires changing VMS code
5225 $   d_unsetenv="undef"   ! Change will be needed to allow GNV integration
5226 $   d_clearenv="undef"
5227 $   d_usleep="define"
5228 $   d_setitimer="define"
5229 $   d_sigaction="define"
5230 $   d_sigprocmask="define"
5231 $   d_truncate="define"
5232 $   d_wait4="define"
5233 $   d_index="define"
5234 $   pidtype="pid_t"
5235 $   sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
5236 $   sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
5237 $   IF (vms_ver .GES. "7.3")
5238 $   THEN
5239 $     sig_name2 = sig_name2 + " NUM27 WINCH"
5240 $   ENDIF
5241 $!* signal.h defines SIGRTMIN as 33 and SIGRTMAX as 64, but there is no 
5242 $!* sigqueue function or other apparent means to do realtime signalling,
5243 $!* so let's not try to include the realtime range for now.
5244 $!* sig_name3=" NUM29 NUM30 NUM31 NUM32 RTMIN NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43"
5245 $!* sig_name4=" NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58"
5246 $!* sig_name5=" NUM59 NUM60 NUM61 NUMT62 NUM63 RTMAX"
5247 $   sig_name = sig_name1 + sig_name2
5248 $   sig_num = ""
5249 $   sig_num_init = ""
5250 $   sig_name_init = ""
5251 $   sig_index = 0
5252 $!
5253 $ PARSE_SIG_NAME_LOOP:
5254 $!
5255 $   tmp = F$ELEMENT(sig_index, " ", sig_name)
5256 $   IF F$LENGTH(F$EDIT(tmp,"TRIM")) .eq. 0 THEN GOTO END_SIG_NAME_LOOP
5257 $   sig_name_init = sig_name_init + """''tmp'"","
5258 $   sig_num = sig_num + "''sig_index' "
5259 $   sig_num_init = sig_num_init + "''sig_index',"
5260 $   sig_index = sig_index + 1
5261 $   GOTO PARSE_SIG_NAME_LOOP
5262 $!
5263 $ END_SIG_NAME_LOOP:
5264 $!
5265 $   sig_name_init = sig_name_init + "0"
5266 $   sig_num_init = sig_num_init + "0"
5267 $   sig_size = "''sig_index'"
5268 $   sig_index = sig_index - 1
5269 $   sig_count = "''sig_index'"
5270 $   uidtype="uid_t"
5271 $   d_pathconf="define"
5272 $   d_fpathconf="define"
5273 $   d_sysconf="define"
5274 $   d_sigsetjmp="define"
5275 $ ELSE
5276 $   pidtype="unsigned int"
5277 $   d_bcmp="undef"
5278 $   d_getitimer="undef"
5279 $   d_gettimeod="undef"
5280 $   d_mmap="undef"
5281 $   d_mprotect="undef"
5282 $   d_munmap="undef"
5283 $   d_msync="undef"
5284 $   d_ualarm="undef"
5285 $   d_uname="undef"
5286 $   d_unsetenv="undef"
5287 $   d_clearenv="undef"
5288 $   d_usleep="undef"
5289 $   d_setitimer="undef"
5290 $   d_sigaction="undef"
5291 $   d_sigprocmask="undef"
5292 $   d_truncate="undef"
5293 $   d_wait4="undef"
5294 $   d_index="undef"
5295 $   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"
5296 $   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
5297 $   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
5298 $   sig_name_init = psnwc1 + psnwc2
5299 $   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"
5300 $   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
5301 $   sig_size="19"
5302 $   sig_count="15"
5303 $   if (vms_ver .GES. "6.2") then sig_count="17"
5304 $   uidtype="unsigned int"
5305 $   d_pathconf="undef"
5306 $   d_fpathconf="undef"
5307 $   d_sysconf="undef"
5308 $   d_sigsetjmp="undef"
5309 $ ENDIF
5310 $!: see if tzname[] exists
5311 $ OS
5312 $ WS "#include <stdio.h>"
5313 $ WS "#include <time.h>"
5314 $ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
5315 $ CS
5316 $ GOSUB compile_ok
5317 $ IF compile_status .EQ. good_compile
5318 $ THEN
5319 $   d_tzname = "undef"
5320 $   echo4 "tzname[] NOT found."
5321 $ ELSE
5322 $   d_tzname = "define"
5323 $   echo4 "tzname[] found."
5324 $ ENDIF
5325 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
5326 $!
5327 $ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
5328 $ THEN
5329 $   d_phostname="define"
5330 $ ELSE
5331 $   d_phostname="undef"
5332 $ ENDIF
5333 $!
5334 $! Dec C alone
5335 $ IF ccname .EQS. "DEC"
5336 $ THEN
5337 $   d_mbstowcs="define"
5338 $   d_mbtowc="define"
5339 $   d_stdiobase="define"
5340 $   d_stdio_cnt_lval="define"
5341 $   d_stdio_ptr_lval="define"
5342 $   d_stdstdio="define"
5343 $   d_faststdio="define"
5344 $   d_wcstombs="define"
5345 $   d_mblen="define"
5346 $   d_mktime="define"
5347 $   d_strcoll="define"
5348 $   d_strxfrm="define"
5349 $   d_wctomb="define"
5350 $   i_locale="define"
5351 $   i_langinfo="define"
5352 $   d_locconv="define"
5353 $   IF vms_ver .GES. "6.2"
5354 $   THEN
5355 $     d_nl_langinfo="define"
5356 $   ELSE
5357 $     d_nl_langinfo="undef"
5358 $   ENDIF
5359 $   d_setlocale="define"
5360 $   vms_cc_type="decc"
5361 $ ELSE
5362 $   d_mbstowcs="undef"
5363 $   d_mbtowc="undef"
5364 $   d_stdiobase="undef"
5365 $   d_stdio_cnt_lval="undef"
5366 $   d_stdio_ptr_lval="undef"
5367 $   d_stdstdio="undef"
5368 $   d_faststdio="undef"
5369 $   d_wcstombs="undef"
5370 $   d_mblen="undef"
5371 $   d_mktime="undef"
5372 $   d_strcoll="undef"
5373 $   d_strxfrm="undef"
5374 $   d_wctomb="undef"
5375 $   i_locale="undef"
5376 $   i_langinfo="undef"
5377 $   d_locconv="undef"
5378 $   d_nl_langinfo="undef"
5379 $   d_setlocale="undef"
5380 $ ENDIF
5381 $ d_stdio_ptr_lval_sets_cnt="undef"
5382 $ d_stdio_ptr_lval_nochange_cnt="define"
5383 $ usefaststdio="undef"
5384 $!
5385 $! Sockets?
5386 $ if Has_Socketshr .OR. Has_Dec_C_Sockets
5387 $ THEN
5388 $   d_vms_do_sockets="define"
5389 $   d_htonl="define"
5390 $   d_socket="define"
5391 $   d_sockpair = "undef"
5392 $   if (vms_ver .GES. "8.2") .AND. (archname .NES. "VMS_VAX")
5393 $   then
5394 $     echo "Found 64 bit OpenVMS 8.2, will build with socketpair support"
5395 $     d_sockpair = "define"
5396 $   endif
5397 $   d_select="define"
5398 $   netdb_hlen_type="int"
5399 $   netdb_host_type="char *"
5400 $   netdb_name_type="char *"
5401 $   netdb_net_type="long"
5402 $   d_gethbyaddr="define"
5403 $   d_gethbyname="define"
5404 $   d_getnbyaddr="define"
5405 $   d_getnbyname="define"
5406 $   d_getpbynumber="define"
5407 $   d_getpbyname="define"
5408 $   d_getsbyport="define"
5409 $   d_getsbyname="define"
5410 $   d_gethostprotos="define"
5411 $   d_getnetprotos="define"
5412 $   d_getprotoprotos="define"
5413 $   d_getservprotos="define"
5414 $   IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
5415 $   THEN
5416 $     socksizetype="unsigned int"
5417 $   ELSE
5418 $     socksizetype="int *"
5419 $   ENDIF
5420 $ ELSE
5421 $   d_vms_do_sockets="undef"
5422 $   d_htonl="undef"
5423 $   d_socket="undef"
5424 $   d_socketpair = "undef"
5425 $   d_select="undef"
5426 $   netdb_hlen_type="int"
5427 $   netdb_host_type="char *"
5428 $   netdb_name_type="char *"
5429 $   netdb_net_type="long"
5430 $   d_gethbyaddr="undef"
5431 $   d_gethbyname="undef"
5432 $   d_getnbyaddr="undef"
5433 $   d_getnbyname="undef"
5434 $   d_getpbynumber="undef"
5435 $   d_getpbyname="undef"
5436 $   d_getsbyport="undef"
5437 $   d_getsbyname="undef"
5438 $   d_gethostprotos="undef"
5439 $   d_getnetprotos="undef"
5440 $   d_getprotoprotos="undef"
5441 $   d_getservprotos="undef"
5442 $   socksizetype="undef"
5443 $ ENDIF
5444 $! Threads
5445 $ IF use_threads
5446 $ THEN
5447 $   usethreads="define"
5448 $   d_pthreads_created_joinable="define"
5449 $   if (vms_ver .GES. "7.0")
5450 $   THEN
5451 $     d_oldpthreads="undef"
5452 $   ELSE
5453 $     d_oldpthreads="define"
5454 $   ENDIF
5455 $ ELSE
5456 $   d_oldpthreads="undef"
5457 $   usethreads="undef"
5458 $   d_pthreads_created_joinable="undef"
5459 $ ENDIF
5460 $! 
5461 $! new (5.005_62++) typedefs for primitives
5462 $!
5463 $ echo "Choosing the C types to be used for Perl's internal types..."
5464 $ ivtype="long"
5465 $ uvtype="unsigned long"
5466 $ i8type="char"
5467 $ u8type="unsigned char"
5468 $ i16type="short"
5469 $ u16type="unsigned short"
5470 $ i32type="int"
5471 $ u32type="unsigned int"
5472 $ i64type="long long"
5473 $ u64type="unsigned long long"
5474 $ nvtype="double"
5475 $!
5476 $ IF use64bitint .OR. use64bitint .EQS. "define"
5477 $ THEN
5478 $   ivtype = "''i64type'"
5479 $   uvtype = "''u64type'"
5480 $ ELSE
5481 $   i64size="undef"
5482 $   u64size="undef"
5483 $ ENDIF
5484 $!
5485 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
5486 $ THEN
5487 $   nvtype="long double"
5488 $ ENDIF
5489 $!
5490 $ tmp = "''ivtype'"
5491 $ GOSUB type_size_check
5492 $ ivsize = tmp
5493 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
5494 $ IF ivtype .eqs. "long"
5495 $ THEN longsize = tmp
5496 $ ELSE
5497 $   tmp = "long"
5498 $   GOSUB type_size_check
5499 $   longsize = tmp
5500 $ ENDIF
5501 $!
5502 $ tmp = "''uvtype'"
5503 $ GOSUB type_size_check
5504 $ uvsize = tmp
5505 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
5506 $!
5507 $ tmp = "''i8type'"
5508 $ GOSUB type_size_check
5509 $ i8size = tmp
5510 $!
5511 $ tmp = "''u8type'"
5512 $ GOSUB type_size_check
5513 $ u8size = tmp
5514 $!
5515 $ tmp = "''i16type'"
5516 $ GOSUB type_size_check
5517 $ i16size = tmp
5518 $ IF i16type .eqs. "short"
5519 $ THEN shortsize = tmp
5520 $ ELSE
5521 $   tmp = "short"
5522 $   gosub type_size_check
5523 $   shortsize = tmp
5524 $ ENDIF
5525 $!
5526 $ tmp = "''u16type'"
5527 $ GOSUB type_size_check
5528 $ u16size = tmp
5529 $!
5530 $ tmp = "''i32type'"
5531 $ GOSUB type_size_check
5532 $ i32size = tmp
5533 $ IF i32type .eqs. "int"
5534 $ THEN intsize = tmp
5535 $ ELSE
5536 $   tmp = "int"
5537 $   gosub type_size_check
5538 $   intsize = tmp
5539 $ ENDIF
5540 $!
5541 $ tmp = "''u32type'"
5542 $ gosub type_size_check
5543 $ u32size = tmp
5544 $!
5545 $ tmp = "''nvtype'"
5546 $ GOSUB type_size_check
5547 $ nvsize = tmp
5548 $!
5549 $ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
5550 $ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
5551 $ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
5552 $!
5553 $ d_nv_preserves_uv = "undef"
5554 $ echo4 "Checking how many bits of your UVs your NVs can preserve..."
5555 $ OS
5556 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5557 $ WS "#include <stdlib.h>"
5558 $ WS "#endif"
5559 $ WS "#include <stdio.h>"
5560 $ WS "int main() {"
5561 $ WS "    ''uvtype' u = 0;"
5562 $ WS "    int     n = 8 * ''uvsize';"
5563 $ WS "    int     i;"
5564 $ WS "    for (i = 0; i < n; i++) {"
5565 $ WS "      u = u << 1 | (''uvtype')1;"
5566 $ WS "      if ((''uvtype')(''nvtype')u != u)"
5567 $ WS "        break;"
5568 $ WS "    }"
5569 $ WS "    printf(""%d\n"", i);"
5570 $ WS "    exit(0);"
5571 $ WS "}"
5572 $ CS
5573 $ GOSUB compile
5574 $ nv_preserves_uv_bits = tmp
5575 $ IF F$INTEGER(nv_preserves_uv_bits) .GE. (F$INTEGER(uvsize) * 8)
5576 $ THEN
5577 $   d_nv_preserves_uv = "define"
5578 $   echo "Your NVs can preserve all ''nv_preserves_uv_bits' bits of your UVs."
5579 $ ELSE
5580 $   d_nv_preserves_uv = "undef""
5581 $   echo "Your NVs can preserve only ''nv_preserves_uv_bits' bits of your UVs." 
5582 $ ENDIF
5583 $!
5584 $ nv_overflows_integers_at = "0"
5585 $ echo4 "Checking to find the largest integer value your NVs can hold..."
5586 $ OS
5587 $ WS "#include <stdio.h>"
5588 $ WS ""
5589 $ WS "typedef ''nvtype' NV;"
5590 $ WS ""
5591 $ WS "int"
5592 $ WS "main() {"
5593 $ WS "  NV value = 2;"
5594 $ WS "  int count = 1;"
5595 $ WS ""
5596 $ WS "  while(count < 256) {"
5597 $ WS "    volatile NV up = value + 1.0;"
5598 $ WS "    volatile NV negated = -value;"
5599 $ WS "    volatile NV down = negated - 1.0;"
5600 $ WS "    volatile NV got_up = up - value;"
5601 $ WS "    int up_good = got_up == 1.0;"
5602 $ WS "    int got_down = down - negated;"
5603 $ WS "    int down_good = got_down == -1.0;"
5604 $ WS ""
5605 $ WS "    if (down_good != up_good) {"
5606 $ WS "      fprintf(stderr,"
5607 $ WS "              ""Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n"","
5608 $ WS "              up_good, (double) got_up, down_good, (double) got_down,"
5609 $ WS "              count, (double) value);"
5610 $ WS "      return 1;"
5611 $ WS "    }"
5612 $ WS "    if (!up_good) {"
5613 $ WS "      while (1) {"
5614 $ WS "        if (count > 8) {"
5615 $ WS "          count -= 8;"
5616 $ WS "          fputs(""256.0"", stdout);"
5617 $ WS "        } else {"
5618 $ WS "          count--;"
5619 $ WS "          fputs(""2.0"", stdout);"
5620 $ WS "        }"
5621 $ WS "        if (!count) {"
5622 $ WS "          puts("""");"
5623 $ WS "          return 0;"
5624 $ WS "        }"
5625 $ WS "        fputs(""*"", stdout);"
5626 $ WS "      }"
5627 $ WS "    }"
5628 $ WS "    value *= 2;"
5629 $ WS "    ++count;"
5630 $ WS "  }"
5631 $ WS "  fprintf(stderr, ""Cannot overflow integer range, even at 2**%d (%.20f)\n"","
5632 $ WS "          count, (double) value);"
5633 $ WS "  return 1;"
5634 $ WS "}"
5635 $ CS
5636 $ GOSUB compile
5637 $ IF F$LENGTH(tmp) .GT. 0
5638 $ THEN
5639 $   IF F$EXTRACT(0,1,tmp) .EQS. "2"
5640 $   THEN
5641 $     echo "The largest integer your NVs can preserve is equal to ''tmp'"
5642 $     nv_overflows_integers_at = tmp
5643 $   ELSE
5644 $     echo "Cannot determine the largest integer value your NVs can hold, unexpected output"
5645 $     echo "''tmp'"
5646 $   ENDIF
5647 $ ELSE
5648 $   echo "Cannot determine the largest integer value your NVs can hold"
5649 $ ENDIF
5650 $!
5651 $! Check for signbit (must already know nvtype)
5652 $!
5653 $ echo4 "Checking to see if you have signbit() available to work on ''nvtype'..."
5654 $ OS
5655 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5656 $ WS "#include <stdlib.h>"
5657 $ WS "#endif"
5658 $ WS "#include <fp.h>"
5659 $ WS "#include <stdio.h>"
5660 $ WS "int main()"
5661 $ WS "{"
5662 $ WS "    ''nvtype' x = 0.0;"
5663 $ WS "    ''nvtype' y = -0.0;"
5664 $ WS "    if ((signbit(x) == 0) && (signbit(y) != 0))"
5665 $ WS "        printf(""1\n"");"
5666 $ WS "    else"
5667 $ WS "        printf(""0\n"");"
5668 $ WS "}"
5669 $ CS
5670 $ GOSUB compile
5671 $ IF tmp .EQS. "1" 
5672 $ THEN 
5673 $     d_signbit = "define"
5674 $     echo4 "Yes."
5675 $ ELSE
5676 $     d_signbit = "undef"
5677 $     echo4 "Nope."
5678 $ ENDIF
5679 $!
5680 $ echo4 "Checking if kill() uses SYS$FORCEX or can't be called from a signal handler..."
5681 $ kill_by_sigprc = "undef"
5682 $ OS
5683 $ WS "#include <stdio.h>"
5684 $ WS "#include <signal.h>"
5685 $ WS "#include <unistd.h>"
5686 $ WS "void handler1(int s) { printf(""%d"",s); kill(getpid(),2); }"
5687 $ WS "void handler2(int s) { printf(""%d"",s); }"
5688 $ WS "main(){"
5689 $ WS "    printf(""0"");"
5690 $ WS "    signal(1,handler1);"
5691 $ WS "    signal(2,handler2);"
5692 $ WS "    kill(getpid(),1);"
5693 $ WS "    sleep(1);"
5694 $ WS "    printf(""\n"");"
5695 $ WS "}"
5696 $ CS
5697 $ ON ERROR THEN CONTINUE
5698 $ GOSUB compile
5699 $ IF tmp .NES. "012"
5700 $ THEN 
5701 $   echo4 "Yes, it has at least one of those limitations."
5702 $   echo4 "Checking whether we can use SYS$SIGPRC instead..."
5703 $   OS
5704 $   WS "#include <stdio.h>"
5705 $   WS "#include <lib$routines.h>"
5706 $   WS "unsigned long code = 0;"
5707 $   WS "int handler(unsigned long *args) {"
5708 $   WS "    code = args[1];"
5709 $   WS "    return 1;"
5710 $   WS "}"
5711 $   WS "main() { "
5712 $   WS "    int iss, sys$sigprc();"
5713 $   WS "    lib$establish(handler);"
5714 $   WS "    iss = sys$sigprc(0,0,0x1234);"
5715 $   WS "    iss =  ((iss&1)==1 && code == 0x1234);" 
5716 $   WS "    printf(""%d\n"",iss);"
5717 $   WS "}"
5718 $   CS
5719 $   ON ERROR THEN CONTINUE
5720 $   GOSUB compile
5721 $   IF tmp .EQS. "1"
5722 $   THEN
5723 $       echo4 "Yep, we can."
5724 $       kill_by_sigprc = "define"
5725 $!
5726 $!      Use the same list of signals the CRTL does for recent systems, but cook our own for very old systems.
5727 $!      Note that the list controls what signals can be caught by name as well as what can be raised via kill().
5728 $!
5729 $       if  vms_ver .LTS. "6.2"
5730 $       then
5731 $!          since SIGBUS and SIGSEGV indistinguishable, make them the same here.
5732 $           sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT"
5733 $           psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
5734 $           psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",0"
5735 $           sig_name_init = psnwc1 + psnwc2
5736 $           sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6"
5737 $           sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,0"
5738 $           sig_size="17"
5739 $           sig_count="15"
5740 $       endif
5741 $   ELSE
5742 $       echo4 "Nope, we can't."
5743 $   ENDIF
5744 $ ELSE
5745 $   echo4 "Nope, it doesn't."
5746 $ ENDIF
5747 $ DELETE/SYMBOL tmp
5748 $!
5749 $! Finally the composite ones. All config
5750 $!
5751 $ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
5752 $!
5753 $ IF ccname .EQS. "DEC"
5754 $ THEN
5755 $   ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5756 $ ENDIF
5757 $ i_dirent = "undef"
5758 $ IF ccname .EQS. "CXX"
5759 $ THEN
5760 $   i_dirent = "define"
5761 $   ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5762 $ ENDIF
5763 $ IF use_vmsdebug_perl
5764 $ THEN
5765 $   optimize="/List/Debug/NoOpt"
5766 $   ldflags="/Debug/Trace/Map"
5767 $   dbgprefix = "DBG"
5768 $ ELSE
5769 $   optimize= "/NoList"
5770 $   ldflags="/NoTrace/NoMap"
5771 $   dbgprefix = ""
5772 $ ENDIF
5773 $!
5774 $! Okay, we've got everything configured. Now go write out a config.sh.
5775 $ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
5776 $ echo4 "Creating ''basename_config_sh'..."
5777 $ open/write CONFIG 'config_sh'
5778 $ WC := write CONFIG
5779 $!
5780 $! ##BEGIN WRITE NEW CONSTANTS HERE##
5781 $!
5782 $ WC "#!/bin/sh"
5783 $ WC "#"
5784 $ WC "# This file was produced by Configure.COM on a ''osname' system."
5785 $ WC "#"
5786 $ WC "# Package name      : ''package'"
5787 $ WC "# Source directory  : ''src'"
5788 $ WC "# Configuration time: " + cf_time
5789 $ WC "# Configuration by  : " + cf_by
5790 $ WC "# Target system     : " + myuname
5791 $ WC ""
5792 $ WC "Makefile_SH='" + Makefile_SH + "'"
5793 $ WC "Mcc='" + Mcc + "'"
5794 $ WC "PERL_REVISION='" + revision + "'"
5795 $ WC "PERL_VERSION='" + patchlevel + "'" 
5796 $ WC "PERL_SUBVERSION='" + subversion + "'" 
5797 $ WC "PERL_API_REVISION='" + api_revision + "'"
5798 $ WC "PERL_API_VERSION='" + api_version + "'" 
5799 $ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
5800 $ WC "PERL_PATCHLEVEL='" + perl_patchlevel + "'"
5801 $ WC "perl_patchlevel='" + perl_patchlevel + "'"
5802 $ WC "PERL_CONFIG_SH='true'"
5803 $ WC "_a='" + lib_ext + "'"
5804 $ WC "_exe='" + exe_ext + "'"
5805 $ WC "_o='" + obj_ext + "'"
5806 $ WC "alignbytes='" + alignbytes + "'"
5807 $ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
5808 $ WC "ar='" + "'"
5809 $ WC "archlib='" + archlib + "'"
5810 $ WC "archlibexp='" + archlibexp + "'"
5811 $ WC "archname='" + archname + "'"
5812 $ WC "baserev='" + baserev + "'"
5813 $ WC "bin='" + bin + "'"
5814 $ WC "binexp='" + binexp + "'"
5815 $ WC "builddir='" + builddir + "'"
5816 $ WC "byteorder='1234'"
5817 $ WC "castflags='0'"
5818 $ WC "cc='" + perl_cc + "'"
5819 $ WC "cccdlflags='" + cccdlflags + "'"
5820 $ WC "ccdlflags='" + ccdlflags + "'"
5821 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
5822 $ THEN
5823 $    IF usestdstat .OR. usestdstat .EQS. "define"
5824 $    THEN
5825 $       ccdefines = "_USE_STD_STAT=1"
5826 $    ELSE
5827 $       ccdefines = "_LARGEFILE=1"
5828 $    ENDIF
5829 $ ELSE
5830 $     ccdefines = ""
5831 $ ENDIF
5832 $ IF ccdefines .NES. ""
5833 $ THEN
5834 $   WC "ccflags='" + ccflags + "/Define=" + ccdefines + "'"
5835 $ ELSE
5836 $   WC "ccflags='" + ccflags + "'"
5837 $ ENDIF
5838 $ WC "ccflags_uselargefiles='" + "'"
5839 $ WC "ccname='" + ccname + "'"
5840 $ WC "ccversion='" + ccversion + "'"
5841 $ WC "cf_by='" + cf_by + "'"
5842 $ WC "cf_email='" + cf_email + "'"
5843 $ WC "cf_time='" + cf_time + "'"
5844 $ WC "config_args='" + config_args + "'"
5845 $ WC "config_sh='" + config_sh + "'"
5846 $ WC "cpp_stuff='" + cpp_stuff + "'"
5847 $ WC "cpplast='" + cpplast + "'"
5848 $ WC "cppminus='" + cppminus + "'"
5849 $ WC "cpprun='" + cpprun + "'"
5850 $ WC "cppstdin='" + cppstdin + "'"
5851 $ IF use64bitint .OR. use64bitint .EQS. "define"
5852 $ THEN
5853 $!  gcvt() does not work for > 16 decimal places; fallback to sprintf
5854 $   WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
5855 $ ELSE
5856 $   WC "d_Gconvert='my_gconvert(x,n,t,b)'"
5857 $ ENDIF
5858 $ WC "d_PRIEldbl='" + d_PRIEUldbl + "'"
5859 $ WC "d_PRIFldbl='" + d_PRIFUldbl + "'"
5860 $ WC "d_PRIGldbl='" + d_PRIGUldbl + "'"
5861 $ WC "d_PRIXU64='" + d_PRIXU64 + "'"
5862 $ WC "d_PRId64='" + d_PRId64 + "'"
5863 $ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
5864 $ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
5865 $ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
5866 $ WC "d_PRIo64='" + d_PRIo64 + "'"
5867 $ WC "d_PRIu64='" + d_PRIu64 + "'"
5868 $ WC "d_PRIx64='" + d_PRIx64 + "'"
5869 $ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
5870 $ WC "d__fwalk='undef'"
5871 $ WC "d_access='" + d_access + "'"
5872 $ WC "d_accessx='undef'"
5873 $ WC "d_aintl='undef'"
5874 $ WC "d_alarm='define'"
5875 $ WC "d_archlib='define'"
5876 $ WC "d_asctime64='undef'"
5877 $ WC "d_atolf='" + d_atolf + "'"
5878 $ WC "d_atoll='" + d_atoll + "'"
5879 $ WC "d_attribute_format='" + d_attribut + "'"
5880 $ WC "d_attribute_deprecated='undef'"
5881 $ WC "d_attribute_malloc='undef'"
5882 $ WC "d_attribute_nonnull='undef'"
5883 $ WC "d_attribute_noreturn='undef'"
5884 $ WC "d_attribute_pure='undef'"
5885 $ WC "d_attribute_unused='undef'"
5886 $ WC "d_attribute_warn_unused_result='undef'"
5887 $ WC "d_printf_format_null='undef'"
5888 $ WC "d_bcmp='" + d_bcmp + "'"
5889 $ WC "d_bcopy='" + d_bcopy + "'"
5890 $ WC "d_bincompat3='undef'"
5891 $! WC "d_bsdpgrp='undef'"
5892 $ WC "d_bsdgetpgrp='undef'"
5893 $ WC "d_bsdsetpgrp='undef'"
5894 $ WC "d_builtin_choose_expr='undef'" ! GCC only
5895 $ WC "d_builtin_expect='undef'" ! GCC only
5896 $ WC "d_bzero='" + d_bzero + "'"
5897 $ WC "d_casti32='define'"
5898 $ WC "d_castneg='define'"
5899 $ WC "d_charvspr='undef'"
5900 $ WC "d_chown='define'"
5901 $ WC "d_chroot='undef'"
5902 $ WC "d_chsize='undef'"
5903 $ WC "d_class='undef'"
5904 $ WC "d_cmsghdr_s='undef'"
5905 $ WC "d_const='define'"
5906 $ WC "d_copysignl='define'"
5907 $ WC "d_cplusplus='" + d_cplusplus + "'"
5908 $ WC "d_crypt='define'"
5909 $ WC "d_csh='undef'"
5910 $ WC "d_ctermid='define'"
5911 $ WC "d_ctime64='undef'"
5912 $ WC "d_cuserid='define'"
5913 $ WC "d_c99_variadic_macros='undef'"
5914 $ WC "d_dbl_dig='define'"
5915 $ WC "d_dbminitproto='undef'"
5916 $ WC "d_difftime='define'"
5917 $ WC "d_difftime64='undef'"
5918 $ WC "d_dir_dd_fd='undef'"
5919 $ WC "d_dirfd='undef'"
5920 $ WC "d_dirnamlen='define'"
5921 $ WC "d_dlerror='undef'"
5922 $ WC "d_dlsymun='undef'"
5923 $ WC "d_dosuid='undef'"
5924 $ WC "d_drand48proto='" + d_drand48proto + "'"
5925 $ WC "d_dup2='define'"
5926 $ WC "d_eaccess='undef'"
5927 $ WC "d_endgrent='define'"
5928 $ WC "d_endhent='" + d_endhent + "'"
5929 $ WC "d_endnent='" + d_endnent + "'"
5930 $ WC "d_endpent='" + d_endpent + "'"
5931 $ WC "d_endpwent='define'"
5932 $ WC "d_endsent='" + d_endsent + "'"
5933 $ WC "d_eofnblk='undef'"
5934 $ WC "d_eunice='undef'"
5935 $ WC "d_fchmod='undef'"
5936 $ WC "d_fchdir='undef'"
5937 $ WC "d_fchown='undef'"
5938 $ WC "d_fcntl='" + d_fcntl + "'"
5939 $ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
5940 $ WC "d_fd_set='" + d_fd_set + "'"
5941 $ WC "d_fgetpos='define'"
5942 $ WC "d_finite='undef'"
5943 $ WC "d_finitel='undef'"
5944 $ WC "d_flexfnam='define'"
5945 $ WC "d_flock='undef'"
5946 $ WC "d_flockproto='undef'"
5947 $ WC "d_fork='undef'"
5948 $ WC "d_fp_class='undef'"
5949 $ WC "d_fpathconf='" + d_fpathconf + "'"
5950 $ WC "d_fpclass='undef'"
5951 $ WC "d_fpclassify='undef'"
5952 $ WC "d_fpclassl='undef'"
5953 $ WC "d_fpos64_t='" + d_fpos64_t + "'"
5954 $ WC "d_frexpl='" + d_frexpl + "'"
5955 $ WC "d_fs_data_s='undef'"
5956 $ WC "d_fseeko='" + d_fseeko + "'"
5957 $ WC "d_fsetpos='define'"
5958 $ WC "d_fstatfs='undef'"
5959 $ WC "d_fstatvfs='" + d_fstatvfs + "'"
5960 $ WC "d_fsync='undef'"
5961 $ WC "d_ftello='" + d_ftello + "'"
5962 $ WC "d_futimes='undef'"
5963 $ WC "d_gdbmndbm_h_uses_prototypes='undef'"
5964 $ WC "d_gdbm_ndbm_h_uses_prototypes='undef'"
5965 $ WC "d_getaddrinfo='undef'"
5966 $ WC "d_getcwd='define'"
5967 $ WC "d_getespwnam='undef'"
5968 $ WC "d_getfsstat='undef'"
5969 $ WC "d_getgrent='define'"
5970 $ WC "d_getgrps='undef'"
5971 $ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
5972 $ WC "d_gethbyname='" + d_gethbyname + "'"
5973 $ WC "d_gethent='" + d_gethent + "'"
5974 $ WC "d_gethname='" + d_gethname + "'"
5975 $ WC "d_gethostprotos='" + d_gethostprotos + "'"
5976 $ WC "d_getitimer='" + d_getitimer + "'"
5977 $ WC "d_getlogin='define'"
5978 $ WC "d_getmnt='undef'"
5979 $ WC "d_getmntent='undef'"
5980 $ WC "d_getnameinfo='undef'"
5981 $ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
5982 $ WC "d_getnbyname='" + d_getnbyname + "'"
5983 $ WC "d_getnent='" + d_getnent + "'"
5984 $ WC "d_getnetprotos='" + d_getnetprotos + "'"
5985 $ WC "d_getpagsz='undef'"
5986 $ WC "d_getpbyname='" + d_getpbyname + "'"
5987 $ WC "d_getpbynumber='" + d_getpbynumber + "'"
5988 $ WC "d_getpent='" + d_getpent + "'"
5989 $ WC "d_getpgid='" + d_getpgid + "'"
5990 $ WC "d_getpgrp2='undef'"
5991 $ WC "d_getpgrp='" + d_getpgrp + "'"
5992 $ WC "d_getppid='" + d_getppid + "'"
5993 $ WC "d_getprior='undef'"
5994 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
5995 $ WC "d_getprpwnam='undef'"
5996 $ WC "d_getpwent='define'"
5997 $ WC "d_getsbyname='" + d_getsbyname + "'"
5998 $ WC "d_getsbyport='" + d_getsbyport + "'"
5999 $ WC "d_getsent='" + d_getsent + "'"
6000 $ WC "d_getservprotos='" + d_getservprotos + "'"
6001 $ WC "d_getspnam='undef'"
6002 $ WC "d_gettimeod='" + d_gettimeod + "'"
6003 $ WC "d_gmtime64='undef'"
6004 $ WC "d_gnulibc='undef'"
6005 $ WC "d_grpasswd='undef'"
6006 $ WC "d_hasmntopt='undef'"
6007 $ WC "d_htonl='" + d_htonl + "'"
6008 $ WC "d_ilogbl='undef'"
6009 $ WC "d_inc_version_list='undef'"
6010 $ WC "d_index='" + d_index + "'"
6011 $ WC "d_inetaton='undef'"
6012 $ WC "d_inetntop='undef'"
6013 $ WC "d_inetpton='undef'"
6014 $ WC "d_int64_t='" + d_int64_t + "'"
6015 $ WC "d_isascii='define'"
6016 $ WC "d_isfinite='undef'"
6017 $ WC "d_isinf='undef'"
6018 $ WC "d_isnan='" + d_isnan + "'"
6019 $ WC "d_isnanl='" + d_isnanl + "'"
6020 $ WC "d_killpg='undef'"
6021 $ WC "d_lchown='" + d_lchown + "'"
6022 $ WC "d_ldbl_dig='define'"
6023 $ WC "d_libm_lib_version='undef'"
6024 $ WC "d_link='" + d_link + "'"
6025 $ WC "d_llseek='undef'"
6026 $ WC "d_localtime64='undef'"
6027 $ WC "d_locconv='" + d_locconv + "'"
6028 $ WC "d_lockf='undef'"
6029 $ WC "d_longdbl='" + d_longdbl + "'"
6030 $ WC "d_longlong='" + d_longlong + "'"
6031 $ WC "d_lseekproto='define'"
6032 $ WC "d_lstat='" + d_lstat + "'"
6033 $ WC "d_madvise='undef'"
6034 $ WC "d_malloc_size='undef'"
6035 $ WC "d_malloc_good_size='undef'"
6036 $ WC "d_mblen='" + d_mblen + "'"
6037 $ WC "d_mbstowcs='" + d_mbstowcs + "'"
6038 $ WC "d_mbtowc='" + d_mbtowc + "'"
6039 $ WC "d_memchr='" + d_memchr + "'"
6040 $ WC "d_memcmp='define'"
6041 $ WC "d_memcpy='define'"
6042 $ WC "d_memmove='define'"
6043 $ WC "d_memset='define'"
6044 $ WC "d_mkdir='define'"
6045 $ WC "d_mkdtemp='" + d_mkdtemp + "'"
6046 $ WC "d_mkfifo='undef'"
6047 $ WC "d_mknod='undef'"
6048 $ WC "d_mkstemp='" + d_mkstemp + "'"
6049 $ WC "d_mkstemps='" + d_mkstemps + "'"
6050 $ WC "d_mktime='" + d_mktime + "'"
6051 $ WC "d_mktime64='undef'"
6052 $ WC "d_mmap='" + d_mmap + "'"
6053 $ WC "d_modfl='" + d_modfl + "'"
6054 $ WC "d_modflproto='" + d_modflproto + "'"
6055 $ WC "d_modfl_pow32_bug='undef'"
6056 $ WC "d_mprotect='" + d_mprotect + "'"
6057 $ WC "d_msg='undef'"
6058 $ WC "d_msg_ctrunc='undef'"
6059 $ WC "d_msg_dontroute='undef'"
6060 $ WC "d_msg_oob='undef'"
6061 $ WC "d_msg_peek='undef'"
6062 $ WC "d_msg_proxy='undef'"
6063 $ WC "d_msghdr_s='undef'"
6064 $ WC "d_msync='" + d_msync + "'"
6065 $ WC "d_munmap='" + d_munmap + "'"
6066 $ WC "d_mymalloc='" + d_mymalloc + "'"
6067 $ WC "d_nanosleep='" + d_nanosleep + "'"
6068 $ WC "d_ndbm_h_uses_prototypes='undef'"
6069 $ WC "d_nice='define'"
6070 $ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
6071 $ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
6072 $ WC "nv_overflows_integers_at='" + nv_overflows_integers_at + "'"
6073 $ WC "nv_preserves_uv_bits='" + nv_preserves_uv_bits + "'"
6074 $ WC "d_nv_zero_is_allbits_zero='define'"
6075 $ WC "d_off64_t='" + d_off64_t + "'"
6076 $ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
6077 $ WC "d_oldarchlib='define'"
6078 $ WC "d_oldpthreads='" + d_oldpthreads + "'"
6079 $ WC "d_open3='define'"
6080 $ WC "d_pathconf='" + d_pathconf + "'"
6081 $ WC "d_pause='define'"
6082 $ WC "d_perl_otherlibdirs='undef'"
6083 $ WC "d_phostname='" + d_phostname + "'"
6084 $ WC "d_pipe='define'"
6085 $ WC "d_poll='" + d_poll + "'"
6086 $ WC "d_procselfexe='undef'"
6087 $ WC "d_pseudofork='undef'"
6088 $ WC "d_pthread_atfork='undef'"
6089 $ WC "d_pthread_attr_setscope='" + d_pthread_attr_setscope + "'"
6090 $ WC "d_pthread_yield='" + d_pthread_yield + "'"
6091 $ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
6092 $ WC "d_pwage='undef'"
6093 $ WC "d_pwchange='undef'"
6094 $ WC "d_pwclass='undef'"
6095 $ WC "d_pwcomment='define'"
6096 $ WC "d_pwexpire='undef'"
6097 $ WC "d_pwgecos='define'"
6098 $ WC "d_pwpasswd='define'"
6099 $ WC "d_pwquota='undef'"
6100 $ WC "d_qgcvt='undef'"
6101 $ WC "d_quad='" + d_quad + "'"
6102 $ WC "d_readdir='define'"
6103 $ WC "d_readlink='" + d_readlink + "'"
6104 $ WC "d_readv='undef'"
6105 $ WC "d_realpath='" + d_realpath + "'"
6106 $ WC "d_recvmsg='undef'"
6107 $ WC "d_rename='define'"
6108 $ WC "d_rewinddir='define'"
6109 $ WC "d_rmdir='define'"
6110 $ WC "d_safebcpy='undef'"
6111 $ WC "d_safemcpy='define'"
6112 $ WC "d_sanemcmp='define'"
6113 $ WC "d_sbrkproto='define'"
6114 $ WC "d_scalbnl='undef'"
6115 $ WC "d_sched_yield='" + d_sched_yield + "'"
6116 $ WC "d_scm_rights='undef'"
6117 $ WC "d_seekdir='define'"
6118 $ WC "d_select='" + d_select + "'"
6119 $ WC "d_sem='undef'"
6120 $ WC "d_semctl_semid_ds='undef'"
6121 $ WC "d_semctl_semun='undef'"
6122 $ WC "d_sendmsg='undef'"
6123 $ WC "d_setegid='undef'"
6124 $ WC "d_setenv='" + d_setenv + "'"
6125 $ WC "d_seteuid='" + d_seteuid + "'"
6126 $ WC "d_setgrent='" + d_setgrent + "'"
6127 $ WC "d_setgrps='undef'"
6128 $ WC "d_sethent='" + d_sethent + "'"
6129 $ WC "d_setitimer='" + d_setitimer + "'"
6130 $ WC "d_setlinebuf='undef'"
6131 $ WC "d_setlocale='" + d_setlocale + "'"
6132 $ WC "d_setnent='" + d_setnent + "'"
6133 $ WC "d_setpent='" + d_setpent + "'"
6134 $ WC "d_setpgid='" + d_setpgid + "'"
6135 $ WC "d_setpgrp2='undef'"
6136 $ WC "d_setpgrp='" + d_setpgrp + "'"
6137 $ WC "d_setprior='undef'"
6138 $ WC "d_setproctitle='" + d_setproctitle + "'"
6139 $ WC "d_setpwent='define'"
6140 $ WC "d_setregid='" + d_setregid + "'"
6141 $ WC "d_setresgid='undef'"
6142 $ WC "d_setresuid='undef'"
6143 $ WC "d_setreuid='" + d_setreuid + "'"
6144 $ WC "d_setrgid='undef'"
6145 $ WC "d_setruid='undef'"
6146 $ WC "d_setsent='" + d_setsent + "'"
6147 $ WC "d_setsid='" + d_setsid + "'"
6148 $ WC "d_setvbuf='" + d_setvbuf + "'"
6149 $ WC "d_sfio='undef'"
6150 $ WC "d_shm='undef'"
6151 $ WC "d_shmatprototype='undef'"
6152 $ WC "d_sigaction='" + d_sigaction + "'"
6153 $ WC "d_signbit='" + d_signbit + "'"
6154 $ WC "d_sigprocmask='" + d_sigprocmask + "'"
6155 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
6156 $ WC "d_sitearch='define'"
6157 $ WC "d_sockatmark='undef'"
6158 $ WC "d_sockatmarkproto='undef'"
6159 $ WC "d_socket='" + d_socket + "'"
6160 $ WC "d_socklen_t='" + d_socklen_t + "'"
6161 $ WC "d_sockpair='" + d_sockpair + "'"
6162 $ WC "d_socks5_init='undef'"
6163 $ WC "d_sprintf_returns_strlen='define'"
6164 $ WC "d_sqrtl='define'"
6165 $ WC "d_sresgproto='undef'"
6166 $ WC "d_sresgproto='undef'"
6167 $ WC "d_sresproto='undef'"
6168 $ WC "d_sresuproto='undef'"
6169 $ WC "d_statblks='undef'"
6170 $ WC "d_statfs_f_flags='undef'"
6171 $ WC "d_statfs_s='undef'"
6172 $ WC "d_statfsflags='undef'"
6173 $ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
6174 $ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
6175 $ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'"
6176 $ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'"
6177 $ WC "d_stdio_stream_array='undef'"
6178 $ WC "d_stdiobase='" + d_stdiobase + "'"
6179 $ WC "d_stdstdio='" + d_stdstdio + "'"
6180 $ WC "d_faststdio='" + d_faststdio + "'"
6181 $ WC "d_strchr='define'"
6182 $ WC "d_strcoll='" + d_strcoll + "'"
6183 $ WC "d_strctcpy='define'"
6184 $ WC "d_strerrm='strerror((e),vaxc$errno)'"
6185 $ WC "d_strerror='define'"
6186 $ WC "d_strftime='define'"
6187 $ WC "d_strlcat='undef'"
6188 $ WC "d_strlcpy='undef'"
6189 $ WC "d_strtod='define'"
6190 $ WC "d_strtol='define'"
6191 $ WC "d_strtold='" + d_strtold + "'"
6192 $ WC "d_strtoll='" + d_strtoll + "'"
6193 $ WC "d_strtoq='" + d_strtoq + "'"
6194 $ WC "d_strtoul='define'"
6195 $ WC "d_strtoull='" + d_strtoull + "'"
6196 $ WC "d_strtouq='" + d_strtouq + "'"
6197 $ WC "d_strxfrm='" + d_strxfrm  + "'"
6198 $ WC "d_suidsafe='undef'"
6199 $ WC "d_symlink='" + d_symlink + "'"
6200 $ WC "d_syscall='undef'"
6201 $ WC "d_syscallproto='undef'"
6202 $ WC "d_sysconf='" + d_sysconf + "'"
6203 $ WC "d_syserrlst='undef'"
6204 $ WC "d_system='define'"
6205 $ WC "d_tcgetpgrp='undef'"
6206 $ WC "d_tcsetpgrp='undef'"
6207 $ WC "d_telldir='define'"
6208 $ WC "d_telldirproto='define'"
6209 $ WC "d_time='define'"
6210 $ WC "d_timegm='undef'"
6211 $ WC "d_times='define'"
6212 $ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."7.0")
6213 $ THEN
6214 $   WC "d_tm_tm_gmtoff='define'"
6215 $   WC "d_tm_tm_zone='define'"
6216 $ ELSE
6217 $   WC "d_tm_tm_gmtoff='undef'"
6218 $   WC "d_tm_tm_zone='undef'"
6219 $ ENDIF
6220 $ WC "d_truncate='" + d_truncate + "'"
6221 $ WC "d_tzname='" + d_tzname + "'"
6222 $ WC "d_u32align='define'"
6223 $ WC "d_ualarm='" + d_ualarm + "'"
6224 $ WC "d_umask='define'"
6225 $ WC "d_uname='" + d_uname + "'"
6226 $ WC "d_union_semun='undef'"
6227 $ WC "d_unlink_all_versions='" + d_unlink_all_versions + "'"    ! VMS-specific
6228 $ WC "d_unordered='undef'"
6229 $ WC "d_unsetenv='" + d_unsetenv + "'"
6230 $ WC "d_clearenv='" + d_clearenv + "'"
6231 $ WC "d_usleep='" + d_usleep + "'"
6232 $ WC "d_usleepproto='" + d_usleep + "'"
6233 $ WC "d_ustat='undef'"
6234 $ WC "d_vendorarch='undef'"
6235 $ WC "d_vendorlib='undef'"
6236 $ WC "d_vfork='define'"
6237 $ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
6238 $ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
6239 $ WC "d_void_closedir='define'"
6240 $ WC "d_volatile='define'"
6241 $ WC "d_vprintf='define'"
6242 $ WC "d_vsnprintf='" + d_vsnprintf + "'"
6243 $ WC "d_wait4='" + d_wait4 + "'"
6244 $ WC "d_waitpid='define'"
6245 $ WC "d_wcstombs='" + d_wcstombs + "'"
6246 $ WC "d_wctomb='" + d_wctomb + "'"
6247 $ WC "d_writev='undef'"
6248 $ WC "db_hashtype=' '"
6249 $ WC "db_prefixtype=' '"
6250 $ WC "db_version_major='" + "'"
6251 $ WC "db_version_minor='" + "'"
6252 $ WC "db_version_patch='" + "'"
6253 $ WC "dbgprefix='" + dbgprefix + "'"
6254 $ WC "defvoidused='15'"
6255 $ WC "devtype='" + devtype + "'"
6256 $ WC "direntrytype='struct dirent'"
6257 $ WC "dlext='" + dlext + "'"
6258 $ WC "dlobj='" + dlobj + "'"
6259 $ WC "dlsrc='dl_vms.c'"
6260 $ WC "doublesize='" + doublesize + "'"
6261 $ WC "drand01='" + drand01 + "'"
6262 $ WC "dtrace='" + "'"
6263 $!
6264 $! The extensions symbol may be quite long
6265 $!
6266 $ tmp = "dynamic_ext='" + extensions + "'"
6267 $ WC/symbol tmp
6268 $ DELETE/SYMBOL tmp
6269 $ WC "eagain=' '"
6270 $ WC "ebcdic='undef'"
6271 $ WC "embedmymalloc='" + usemymalloc + "'"
6272 $ WC "eunicefix=':'"
6273 $ WC "exe_ext='" + exe_ext + "'"
6274 $!
6275 $! The extensions symbol may be quite long
6276 $!
6277 $ tmp = "extensions='" + extensions + "'"
6278 $ WC/symbol tmp
6279 $ DELETE/SYMBOL tmp
6280 $ WC "fflushNULL='define'"
6281 $ WC "fflushall='undef'"
6282 $ WC "fpostype='fpos_t'"
6283 $ WC "freetype='void'"
6284 $ WC "full_ar='" + "'"
6285 $ WC "full_csh='" + " '"
6286 $ WC "full_sed='_NLA0:'"
6287 $ WC "gccversion='" + gccversion + "'"
6288 $ WC "gidformat='lu'"
6289 $ WC "gidsign='1'"
6290 $ WC "gidsize='4'"
6291 $ WC "gidtype='" + gidtype + "'"
6292 $ WC "groupstype='Gid_t'"
6293 $ WC "hint='none'"
6294 $ WC "hintfile='" + "'"
6295 $ WC "i16size='" + i16size + "'"
6296 $ WC "i16type='" + i16type + "'"
6297 $ WC "i32size='" + i32size + "'"
6298 $ WC "i32type='" + i32type + "'"
6299 $ WC "i64size='" + i64size + "'"
6300 $ WC "i64type='" + i64type + "'"
6301 $ WC "i8size='" + i8size + "'"
6302 $ WC "i8type='" + i8type + "'"
6303 $ WC "i_arpainet='undef'"
6304 $ WC "i_assert='define'"
6305 $ WC "i_crypt='undef'"
6306 $ WC "i_db='undef'"
6307 $ WC "i_dbm='undef'"
6308 $ WC "i_dirent='" + i_dirent + "'"
6309 $ WC "i_dlfcn='undef'"
6310 $ WC "i_fcntl='" + i_fcntl + "'"
6311 $ WC "i_float='define'"
6312 $ WC "i_fp='undef'"
6313 $ WC "i_fp_class='undef'"
6314 $ WC "i_gdbm='undef'"
6315 $ WC "i_gdbm_ndbm='undef'"
6316 $ WC "i_gdbmndbm='undef'"
6317 $ WC "i_grp='" + i_grp + "'"
6318 $ WC "i_ieeefp='undef'"
6319 $ WC "i_inttypes='" + i_inttypes + "'"
6320 $ WC "i_langinfo='" + i_langinfo + "'"
6321 $ WC "i_libutil='" + i_libutil + "'"
6322 $ WC "i_limits='define'"
6323 $ WC "i_locale='" + i_locale + "'"
6324 $ WC "i_machcthr='undef'"
6325 $ WC "i_machcthreads='undef'"
6326 $ WC "i_mallocmalloc='undef'"
6327 $ WC "i_math='define'"
6328 $ WC "i_memory='undef'"
6329 $ WC "i_mntent='undef'"
6330 $ WC "i_ndbm='undef'"
6331 $ WC "i_netdb='" + i_netdb + "'"
6332 $ WC "i_neterrno='define'"
6333 $ WC "i_netinettcp='" + i_netinettcp + "'"
6334 $ WC "i_niin='" + i_niin + "'"
6335 $ WC "i_poll='" + i_poll + "'"
6336 $ WC "i_prot='undef'"
6337 $ WC "i_pthread='define'"
6338 $ WC "i_pwd='undef'"
6339 $ WC "i_rpcsvcdbm='undef'"
6340 $ WC "i_sfio='undef'"
6341 $ WC "i_sgtty='undef'"
6342 $ WC "i_shadow='" + i_shadow + "'"
6343 $ WC "i_socks='" + i_socks + "'"
6344 $ WC "i_stdarg='define'"
6345 $ WC "i_stddef='define'"
6346 $ WC "i_stdlib='define'"
6347 $ WC "i_string='define'"
6348 $ WC "i_sunmath='undef'"
6349 $ WC "i_sysaccess='" + i_sysaccess + "'"
6350 $ WC "i_sysdir='undef'"
6351 $ WC "i_sysfile='" + i_sysfile + "'"
6352 $ WC "i_sysioctl='" + i_sysioctl + "'"
6353 $ WC "i_syslog='" + i_syslog + "'"
6354 $ WC "i_sysmman='undef'"
6355 $ WC "i_sysmode='" + i_sysmode + "'"
6356 $ WC "i_sysmount='undef'"
6357 $ WC "i_sysndir='undef'"
6358 $ WC "i_sysparam='undef'"
6359 $ WC "i_syspoll='" + i_syspoll + "'"
6360 $ WC "i_sysresrc='undef'"
6361 $ WC "i_syssecrt='" + i_syssecrt + "'"
6362 $ WC "i_sysselct='undef'"
6363 $ WC "i_syssockio='undef'"
6364 $ WC "i_sysstat='define'"
6365 $ WC "i_sysstatfs='undef'"
6366 $ WC "i_sysstatvfs='" + i_sysstatvfs + "'"
6367 $ WC "i_systime='undef'"
6368 $ WC "i_systimek='undef'"
6369 $ WC "i_systimes='undef'"
6370 $ WC "i_systypes='define'"
6371 $ WC "i_sysuio='" + i_sysuio + "'"
6372 $ WC "i_sysun='undef'"
6373 $ WC "i_sysutsname='" + i_sysutsname + "'"
6374 $ WC "i_sysvfs='undef'"
6375 $ WC "i_syswait='undef'"
6376 $ WC "i_termio='undef'"
6377 $ WC "i_termios='undef'"
6378 $ WC "i_time='define'"
6379 $ WC "i_unistd='" + i_unistd + "'"
6380 $ WC "i_ustat='undef'"
6381 $ WC "i_utime='" + i_utime + "'"
6382 $ WC "i_values='undef'"
6383 $ WC "i_varargs='undef'"
6384 $ WC "i_vfork='undef'"
6385 $ WC "inc_version_list='0'"
6386 $ WC "inc_version_list_init='0'"
6387 $ WC "installarchlib='" + installarchlib + "'"
6388 $ WC "installbin='" + installbin + "'"
6389 $ WC "installman1dir='" + installman1dir + "'"
6390 $ WC "installman3dir='" + installman3dir + "'"
6391 $ WC "installprefix='" + vms_prefix + "'"
6392 $ WC "installprefixexp='" + vms_prefix + ":'"
6393 $ WC "installprivlib='" + installprivlib + "'"
6394 $ WC "installscript='" + installscript + "'"
6395 $ WC "installsitearch='" + installsitearch + "'"
6396 $ WC "installsitebin='" + sitebin + "'"
6397 $ WC "installsitelib='" + installsitelib + "'"
6398 $ WC "installusrbinperl='undef'"
6399 $ WC "intsize='" + intsize + "'"
6400 $ WC "ivdformat='" + ivdformat + "'"
6401 $ WC "ivsize='" + ivsize + "'"
6402 $ WC "ivtype='" + ivtype + "'"
6403 $!
6404 $! The known_extensions symbol may be quite long
6405 $!
6406 $ tmp = "known_extensions='" + known_extensions + "'"
6407 $ WC/symbol tmp
6408 $ DELETE/SYMBOL tmp
6409 $ WC "ld='" + ld + "'"
6410 $ WC "lddlflags='/Share'"
6411 $ WC "ldflags='" + ldflags + "'"
6412 $ WC "ldflags_uselargefiles='" + "'"
6413 $ WC "lib_ext='" + lib_ext + "'"
6414 $ WC "libc='" + libc + "'"
6415 $ WC "libpth='/sys$share /sys$library'"
6416 $ WC "libs='" + libs + "'"
6417 $ WC "libswanted='" + "'"
6418 $ WC "libswanted_uselargefiles='" + "'"
6419 $ WC "longdblsize='" + longdblsize + "'"
6420 $ WC "longlongsize='" + longlongsize + "'"
6421 $ WC "longsize='" + longsize + "'"
6422 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
6423 $ THEN
6424 $   WC "lseeksize='8'"
6425 $   WC "lseektype='off_t'"
6426 $ ELSE
6427 $   WC "lseeksize='4'"
6428 $   WC "lseektype='int'"
6429 $ ENDIF
6430 $ WC "mab='" + "'"
6431 $ WC "mad='undef'"
6432 $ WC "make='" + make + "'"
6433 $ WC "malloctype='void *'"
6434 $ WC "usemallocwrap='" + usemallocwrap + "'"
6435 $ WC "man1ext='rno'"
6436 $ WC "man3ext='rno'"
6437 $ WC "mmaptype='void *'"
6438 $ WC "modetype='unsigned int'"
6439 $ WC "multiarch='undef'"
6440 $ WC "mydomain='" + mydomain + "'"
6441 $ WC "myhostname='" + myhostname + "'"
6442 $ WC "myuname='" + myuname + "'"
6443 $ WC "need_va_copy='undef'"
6444 $ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
6445 $ WC "netdb_host_type='" + netdb_host_type + "'"
6446 $ WC "netdb_name_type='" + netdb_name_type + "'"
6447 $ WC "netdb_net_type='" + netdb_net_type + "'"
6448 $ tmp = "nonxs_ext='" + nonxs_ext + "'"
6449 $ WC/symbol tmp
6450 $ DELETE/SYMBOL tmp
6451 $ WC "nveformat='" + nveformat + "'"
6452 $ WC "nvfformat='" + nvfformat + "'"
6453 $ WC "nvgformat='" + nvgformat + "'"
6454 $ WC "nvsize='" + nvsize + "'"
6455 $ WC "nvtype='" + nvtype + "'"
6456 $ WC "o_nonblock=' '"
6457 $ WC "obj_ext='" + obj_ext + "'"
6458 $ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
6459 $ WC "oldarchlib='" + oldarchlib + "'"
6460 $ WC "oldarchlibexp='" + oldarchlibexp + "'"
6461 $ WC "optimize='" + optimize + "'"
6462 $ WC "osname='" + osname + "'"
6463 $ WC "osvers='" + osvers + "'"
6464 $ WC "otherlibdirs='" + "'"
6465 $ WC "package='" + package + "'"
6466 $ WC "pager='" + pager + "'"
6467 $ WC "patchlevel='" + patchlevel + "'"
6468 $ WC "path_sep='|'"
6469 $ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
6470 $ WC "perladmin='" + perladmin + "'"
6471 $ WC "perllibs='" + perllibs + "'"
6472 $ WC "perlpath='" + "''vms_prefix':[000000]Perl''exe_ext'" + "'"
6473 $ WC "perl_symbol='" + perl_symbol + "'"  ! VMS specific
6474 $ WC "perl_verb='" + perl_verb + "'"      ! VMS specific
6475 $ WC "pgflquota='" + pgflquota + "'"
6476 $ WC "pidtype='" + pidtype + "'"
6477 $ WC "prefix='" + vms_prefix + "'"
6478 $ WC "prefixexp='" + vms_prefix + ":'"
6479 $ WC "privlib='" + privlib + "'"
6480 $ WC "privlibexp='" + privlibexp + "'"
6481 $ WC "procselfexe=' '"
6482 $ WC "prototype='define'"
6483 $ WC "ptrsize='" + ptrsize + "'"
6484 $ WC "quadkind='" + quadkind + "'"
6485 $ WC "quadtype='" + quadtype + "'" 
6486 $ WC "randbits='" + randbits + "'"
6487 $ WC "randfunc='" + randfunc + "'"
6488 $ WC "randseedtype='" + randseedtype + "'"
6489 $ WC "ranlib='" + "'"
6490 $ WC "rd_nodata=' '"
6491 $ WC "revision='" + revision + "'"
6492 $ WC "sGMTIME_max='4294967295'"
6493 $ WC "sGMTIME_min='0'"
6494 $ WC "sLOCALTIME_max='4294967295'"
6495 $ WC "sLOCALTIME_min='0'"
6496 $ WC "sPRId64='" + sPRId64 + "'"
6497 $ WC "sPRIEldbl='" + sPRIEUldbl + "'"
6498 $ WC "sPRIFldbl='" + sPRIFUldbl + "'"
6499 $ WC "sPRIGldbl='" + sPRIGUldbl + "'"
6500 $ WC "sPRIX64='" + sPRIXU64 + "'"
6501 $ WC "sPRIeldbl='" + sPRIeldbl + "'"
6502 $ WC "sPRIfldbl='" + sPRIfldbl + "'"
6503 $ WC "sPRIgldbl='" + sPRIgldbl + "'"
6504 $! WC "sPRIi64='" + sPRIi64 + "'"
6505 $ WC "sPRIo64='" + sPRIo64 + "'"
6506 $ WC "sPRIu64='" + sPRIu64 + "'"
6507 $ WC "sPRIx64='" + sPRIx64 + "'"
6508 $ WC "sSCNfldbl='" + sSCNfldbl + "'"
6509 $ WC "sched_yield='" + sched_yield + "'"
6510 $ WC "scriptdir='" + scriptdir + "'"
6511 $ WC "scriptdirexp='" + scriptdir + "'"  ! use scriptdir for now
6512 $ WC "seedfunc='" + seedfunc + "'"
6513 $ WC "selectminbits='32'"
6514 $ WC "selecttype='" + selecttype + "'"
6515 $ WC "sh='MCR'"
6516 $ WC "sharpbang='#!'"
6517 $ WC "shmattype='" + " '"
6518 $ WC "shortsize='" + shortsize + "'"
6519 $ IF (f$length(sig_name) .GE. 244)
6520 $ THEN
6521 $     tmp = "sig_name='" + sig_name + "'"
6522 $     WC/symbol tmp
6523 $     DELETE/SYMBOL tmp
6524 $ ELSE
6525 $     WC "sig_name='" + sig_name + "'"
6526 $ ENDIF
6527 $ IF (f$length(sig_name_init) .GE. 244)
6528 $ THEN
6529 $     tmp = "sig_name_init='" + sig_name_init + "'"
6530 $     WC/symbol tmp
6531 $     DELETE/SYMBOL tmp
6532 $ ELSE
6533 $     WC "sig_name_init='" + sig_name_init + "'"
6534 $ ENDIF
6535 $ WC "sig_num='" + sig_num + "'"
6536 $ WC "sig_num_init='" + sig_num_init + "'"
6537 $ WC "sig_count='" + sig_count + "'"
6538 $ WC "sig_size='" + sig_size + "'"
6539 $ WC "signal_t='" + signal_t + "'"
6540 $ WC "sitearch='" + sitearch + "'"
6541 $ WC "sitearchexp='" + sitearchexp + "'"
6542 $ WC "sitebin='" + sitebin + "'"
6543 $ WC "sitebinexp='" + sitebin + "'"
6544 $ WC "sitelib='" + sitelib + "'"
6545 $ WC "sitelib_stem='" + sitelib_stem + "'"
6546 $ WC "sitelibexp='" + sitelibexp + "'"
6547 $ WC "siteprefix='" + vms_prefix + "'"
6548 $ WC "siteprefixexp='" + vms_prefix + ":'"
6549 $ WC "sizesize='" + sizesize + "'"
6550 $ WC "sizetype='size_t'"
6551 $ WC "so='" + so + "'"
6552 $ WC "socksizetype='" + socksizetype + "'"
6553 $ WC "spitshell='write sys$output '"
6554 $ WC "src='" + src + "'"
6555 $ WC "ssizetype='int'"
6556 $ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
6557 $ WC "static_ext='" + static_ext + "'"
6558 $ WC "stdchar='" + stdchar + "'"
6559 $ WC "stdio_base='((*fp)->_base)'"
6560 $ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
6561 $ WC "stdio_cnt='((*fp)->_cnt)'"
6562 $ WC "stdio_ptr='((*fp)->_ptr)'"
6563 $ WC "stdio_stream_array=' " + "'"
6564 $ WC "subversion='" + subversion + "'"
6565 $ WC "targetarch='" + "'"
6566 $ WC "timetype='" + timetype + "'"
6567 $ WC "u16size='" + u16size + "'"
6568 $ WC "u16type='" + u16type + "'"
6569 $ WC "u32size='" + u32size + "'"
6570 $ WC "u32type='" + u32type + "'"
6571 $ WC "u64size='" + u64size + "'"
6572 $ WC "u64type='" + u64type + "'"
6573 $ WC "u8size='" + u8size + "'"
6574 $ WC "u8type='" + u8type + "'"
6575 $ WC "uidformat='lu'"
6576 $ WC "uidsign='1'"
6577 $ WC "uidsize='4'"
6578 $ WC "uidtype='" + uidtype + "'"
6579 $ WC "uquadtype='" + uquadtype + "'" 
6580 $ WC "use5005threads='" + use5005threads + "'"
6581 $ WC "use64bitall='" + use64bitall + "'"
6582 $ WC "use64bitint='" + use64bitint + "'"
6583 $ WC "usecasesensitive='" + be_case_sensitive + "'"    ! VMS-specific
6584 $ WC "usedebugging_perl='"+use_debugging_perl+"'"
6585 $ WC "usedefaulttypes='" + usedefaulttypes + "'"    ! VMS-specific
6586 $ WC "usecrosscompile='undef'"
6587 $ WC "usedevel='" + usedevel + "'"
6588 $ WC "usedl='" + usedl + "'"
6589 $ WC "usedtrace='undef'"
6590 $ WC "usefaststdio='" + usefaststdio + "'"
6591 $ WC "useieee='" + useieee + "'"                    ! VMS-specific
6592 $ WC "useithreads='" + useithreads + "'"
6593 $ WC "usekernelthreads='" + usekernelthreads + "'"      ! VMS-specific
6594 $ WC "uselargefiles='" + uselargefiles + "'"
6595 $ WC "uselongdouble='" + uselongdouble + "'"
6596 $ WC "usemorebits='" + usemorebits + "'"
6597 $ WC "usemultiplicity='" + usemultiplicity + "'"
6598 $ WC "usemymalloc='" + usemymalloc + "'"
6599 $ WC "useperlio='" + useperlio + "'"
6600 $ WC "useposix='false'"
6601 $ WC "usereentrant='undef'"
6602 $ WC "userelocatableinc='undef'"
6603 $ WC "usesecurelog='" + usesecurelog + "'"  ! VMS-specific
6604 $ WC "useshrplib='true'"
6605 $ WC "usesitecustomize='" + usesitecustomize + "'"
6606 $ WC "usesocks='undef'"
6607 $ WC "usethreads='" + usethreads + "'"
6608 $ WC "usethreadupcalls='" + usethreadupcalls + "'"      ! VMS-specific
6609 $ WC "usevendorprefix='" + "'" ! try to say no, though we'll be ignored as of MM 5.90_01
6610 $ WC "usevfork='true'"
6611 $ WC "usevmsdebug='" + usevmsdebug + "'"     ! VMS-specific
6612 $ WC "uvoformat='" + uvoformat + "'"
6613 $ WC "uvsize='" + uvsize + "'"
6614 $ WC "uvtype='" + uvtype + "'"
6615 $ WC "uvuformat='" + uvuformat + "'"
6616 $ WC "uvxformat='" + uvxformat + "'"
6617 $ WC "uvXUformat='" + uvXUformat + "'"
6618 $ WC "vendorarch='" + "'"
6619 $ WC "vendorarchexp='" + "'"
6620 $ WC "vendorbin='" + "'"
6621 $ WC "vendorbinexp='" + "'"
6622 $ WC "vendorlib_stem='" + "'"
6623 $ WC "vendorlib='" + "'"
6624 $ WC "vendorlibexp='" + "'"
6625 $ WC "vendorprefix='" + "'"
6626 $ WC "vendorprefixexp='" + "'"
6627 $ WC "version='" + version + "'"
6628 $ WC "version_patchlevel_string='" + version_patchlevel_string + "'"
6629 $ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
6630 $ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
6631 $ WC "vms_ver='" + vms_ver + "'" ! VMS specific
6632 $ WC "voidflags='15'"
6633 $!
6634 $! ## The UNIXy POSIXy reentrantey thingys ##
6635 $! See "Appendix B, Version-Dependency Tables" in the C RTL
6636 $! manual for when assorted _r functions became available.
6637 $!
6638 $ IF use_threads .AND. vms_ver .GES. "7.2"
6639 $ THEN
6640 $   WC "asctime_r_proto='REENTRANT_PROTO_B_SB'"
6641 $   WC "d_asctime_r='define'"
6642 $   WC "ctime_r_proto='REENTRANT_PROTO_B_SB'"
6643 $   WC "d_ctime_r='define'"
6644 $ ELSE
6645 $   WC "asctime_r_proto='0'"
6646 $   WC "d_asctime_r='undef'"
6647 $   WC "ctime_r_proto='0'"
6648 $   WC "d_ctime_r='undef'"
6649 $ ENDIF
6650 $ WC "d_crypt_r='undef'"
6651 $ WC "d_ctermid_r='undef'"
6652 $ WC "d_drand48_r='undef'"
6653 $ WC "d_endgrent_r='undef'"
6654 $ WC "d_endhostent_r='undef'"
6655 $ WC "d_endnetent_r='undef'"
6656 $ WC "d_endprotoent_r='undef'"
6657 $ WC "d_endpwent_r='undef'"
6658 $ WC "d_endservent_r='undef'"
6659 $ WC "d_getgrent_r='undef'"
6660 $ WC "d_getgrgid_r='" + d_getgrgid_r + "'"
6661 $ WC "d_getgrnam_r='" + d_getgrnam_r + "'"
6662 $ WC "d_gethostbyaddr_r='undef'"
6663 $ WC "d_gethostbyname_r='undef'"
6664 $ WC "d_gethostent_r='undef'"
6665 $ WC "d_getlogin_r='undef'"
6666 $ WC "d_getnetbyaddr_r='undef'"
6667 $ WC "d_getnetbyname_r='undef'"
6668 $ WC "d_getnetent_r='undef'"
6669 $ WC "d_getprotobyname_r='undef'"
6670 $ WC "d_getprotobynumber_r='undef'"
6671 $ WC "d_getprotoent_r='undef'"
6672 $ WC "d_getpwent_r='undef'"
6673 $ WC "d_getpwnam_r='" + d_getpwnam_r + "'"
6674 $ WC "d_getpwuid_r='" + d_getpwuid_r + "'"
6675 $ WC "d_getservbyname_r='undef'"
6676 $ WC "d_getservbyport_r='undef'"
6677 $ WC "d_getservent_r='undef'"
6678 $ WC "d_getspnam_r='undef'"
6679 $ WC "d_gmtime_r='undef'"      ! leave undef'd; we use my_gmtime
6680 $ WC "d_localtime_r='undef'"   ! leave undef'd; we use my_localtime
6681 $ WC "d_localtime_r_needs_tzset='undef'"
6682 $ WC "d_random_r='undef'"
6683 $ WC "d_readdir_r='define'"     ! always defined; we roll our own
6684 $ WC "d_readdir64_r='undef'"
6685 $ WC "d_setgrent_r='undef'"
6686 $ WC "d_sethostent_r='undef'"
6687 $ WC "d_setlocale_r='undef'"
6688 $ WC "d_setnetent_r='undef'"
6689 $ WC "d_setprotoent_r='undef'"
6690 $ WC "d_setpwent_r='undef'"
6691 $ WC "d_setservent_r='undef'"
6692 $ WC "d_snprintf='" + d_snprintf + "'"
6693 $ WC "d_srand48_r='undef'"
6694 $ WC "d_srandom_r='undef'"
6695 $ WC "d_strerror_r='undef'"
6696 $ WC "d_tmpnam_r='undef'"
6697 $ WC "d_ttyname_r='" + d_ttyname_r + "'"
6698 $ WC "ctermid_r_proto='0'"
6699 $ WC "crypt_r_proto='0'"
6700 $ WC "drand48_r_proto='0'"
6701 $ WC "endgrent_r_proto='0'"
6702 $ WC "endhostent_r_proto='0'"
6703 $ WC "endnetent_r_proto='0'"
6704 $ WC "endprotoent_r_proto='0'"
6705 $ WC "endpwent_r_proto='0'"
6706 $ WC "endservent_r_proto='0'"
6707 $ WC "getgrent_r_proto='0'"
6708 $ WC "getgrgid_r_proto='" + getgrgid_r_proto + "'"
6709 $ WC "getgrnam_r_proto='" + getgrnam_r_proto + "'"
6710 $ WC "gethostbyaddr_r_proto='0'"
6711 $ WC "gethostbyname_r_proto='0'"
6712 $ WC "gethostent_r_proto='0'"
6713 $ WC "getlogin_r_proto='0'"
6714 $ WC "getnetbyaddr_r_proto='0'"
6715 $ WC "getnetbyname_r_proto='0'"
6716 $ WC "getnetent_r_proto='0'"
6717 $ WC "getprotobyname_r_proto='0'"
6718 $ WC "getprotobynumber_r_proto='0'"
6719 $ WC "getprotoent_r_proto='0'"
6720 $ WC "getpwent_r_proto='0'"
6721 $ WC "getpwnam_r_proto='0'"
6722 $ WC "getpwuid_r_proto='0'"
6723 $ WC "getservbyname_r_proto='0'"
6724 $ WC "getservbyport_r_proto='0'"
6725 $ WC "getservent_r_proto='0'"
6726 $ WC "getspnam_r_proto='0'"
6727 $ WC "gmtime_r_proto='0'"
6728 $ WC "localtime_r_proto='0'"
6729 $ WC "random_r_proto='0'"
6730 $ WC "readdir_r_proto='REENTRANT_PROTO_I_TSR'"  ! always defined; we roll our own
6731 $ WC "readdir64_r_proto='0'"
6732 $ WC "setgrent_r_proto='0'"
6733 $ WC "sethostent_r_proto='0'"
6734 $ WC "setlocale_r_proto='0'"
6735 $ WC "setnetent_r_proto='0'"
6736 $ WC "setprotoent_r_proto='0'"
6737 $ WC "setpwent_r_proto='0'"
6738 $ WC "setservent_r_proto='0'"
6739 $ WC "srand48_r_proto='0'"
6740 $ WC "srandom_r_proto='0'"
6741 $ WC "strerror_r_proto='0'"
6742 $ WC "tmpnam_r_proto='0'"
6743 $ WC "ttyname_r_proto='" + ttyname_r_proto + "'"
6744 $!
6745 $! ##END WRITE NEW CONSTANTS HERE##
6746 $!
6747 $ CLOSE CONFIG
6748 $!
6749 $! Okay, we've gotten here. Build munchconfig.exe
6750 $ COPY/NOLOG [-.vms]munchconfig.c []
6751 $ COPY/NOLOG [-.vms]'Makefile_SH' []
6752 $ 'Perl_CC' 'ccflags' munchconfig.c
6753 $ IF Needs_Opt
6754 $ THEN
6755 $   OPEN/WRITE CONFIG []munchconfig.opt
6756 $   IF ccname .EQS. "GCC"
6757 $   THEN
6758 $     WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
6759 $   ENDIF
6760 $   WRITE CONFIG "Sys$Share:VAXCRTL/Share"
6761 $   CLOSE CONFIG
6762 $   'ld' munchconfig.obj,munchconfig.opt/opt
6763 $   DELETE/NOLOG/NOCONFIRM munchconfig.opt;
6764 $ ELSE
6765 $   'ld' munchconfig.obj
6766 $ ENDIF
6767 $ IF F$SEARCH("munchconfig.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.obj;
6768 $ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
6769 $ IF ccname .EQS. "CXX"
6770 $ THEN
6771 $   CALL Cxx_demangler_cleanup
6772 $ ENDIF
6773 $!
6774 $ IF alldone .EQS. ""
6775 $ THEN
6776 $   cat4 SYS$INPUT:
6777 $   DECK
6778
6779 If you'd like to make any changes to the config.sh file before I begin
6780 to configure things, answer yes to the following question.
6781
6782 $   EOD
6783 $   bool_dflt="n"
6784 $   rp="Do you wish to edit ''basename_config_sh'? [''bool_dflt'] "
6785 $   GOSUB myread
6786 $   IF ans
6787 $   THEN
6788 $     echo4 ""
6789 $     echo4 "Be sure to type LOGOUT after you have edited the file,"
6790 $     echo4 "then this procedure will resume."
6791 $     echo4 ""
6792 $     default = F$ENVIRONMENT("DEFAULT")
6793 $     DIRECTORY 'config_sh'
6794 $     SET DEFAULT [-]
6795 $     SPAWN/WAIT
6796 $     SET DEFAULT 'default'
6797 $   ENDIF
6798 $ ENDIF
6799 $!
6800 $ echo ""
6801 $ echo4 "Adding ''osname' specific preprocessor commands."
6802 $ !
6803 $ ! we need an fdl file
6804 $ CREATE [-]CONFIG.FDL
6805 $ DECK
6806 RECORD
6807   FORMAT STREAM_LF
6808 $ EOD
6809 $ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
6810 $ ! First spit out the header info with the local defines (to get
6811 $ ! around the 255 character command line limit)
6812 $ OPEN/APPEND CONFIG [-]config.local
6813 $ IF use_debugging_perl THEN WC "#define DEBUGGING"
6814 $ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
6815 $ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
6816 $ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
6817 $ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
6818 $ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
6819 $ IF (Has_Dec_C_Sockets)
6820 $ THEN
6821 $    WC "#define VMS_DO_SOCKETS"
6822 $    WC "#define DECCRTL_SOCKETS"
6823 $ ELSE
6824 $    IF Has_Socketshr THEN WC "#define VMS_DO_SOCKETS"
6825 $ ENDIF
6826 $! This is VMS-specific for now
6827 $ WC "#''d_setenv' HAS_SETENV"
6828 $ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
6829 $ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
6830 $ IF use64bitint .OR. use64bitint .EQS. "define"
6831 $ THEN
6832 $   WC "#define USE_64_BIT_INT"
6833 $   WC "#define USE_LONG_DOUBLE"
6834 $ ENDIF
6835 $ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
6836     WC "#define USE_64_BIT_ALL"
6837 $ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
6838 $ IF use_ieee_math THEN WC "#define USE_IEEE"
6839 $ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
6840 $ WC "#define HAS_ENVGETENV"
6841 $ WC "#define PERL_EXTERNAL_GLOB"
6842 $ IF archname .EQS. "VMS_VAX" .AND. -
6843      ccname .EQS. "DEC" .AND. -
6844      ccversion .LE. 50390006
6845 $ THEN
6846 $! Alas this does not help to build Fcntl
6847 $!   WC "#define PERL_IGNORE_FPUSIG SIGFPE"
6848 $ ENDIF
6849 $ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
6850 $ IF unlink_all_versions .OR. unlink_all_versions .EQS. "define" THEN -
6851     WC "#define UNLINK_ALL_VERSIONS"
6852 $ CLOSE CONFIG
6853 $!
6854 $ echo4 "Doing variable substitutions on .SH files..."
6855 $ echo4 "Extracting config.h (with variable substitutions)"
6856 $!
6857 $! Now build the normal config.h
6858 $ DEFINE/USER_MODE sys$output [-]config.main
6859 $ mcr []munchconfig 'config_sh' [-]config_h.sh
6860 $ ! Concatenate them together
6861 $ copy [-]config.local,[-]config.main [-]config.h
6862 $! Clean up
6863 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.MAIN;*
6864 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.LOCAL;*
6865 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;*
6866 $!
6867 $ IF ccname .EQS. "DEC"
6868 $ THEN
6869 $   DECC_REPLACE = "DECC=decc=1"
6870 $ ELSE
6871 $   DECC_REPLACE = "DECC="
6872 $ ENDIF
6873 $ IF ccname .EQS. "CXX"
6874 $ THEN
6875 $   DECCXX_REPLACE = "DECCXX=DECCXX=1"
6876 $ ELSE
6877 $   DECCXX_REPLACE = "DECCXX="
6878 $ ENDIF
6879 $ IF ccname .EQS. "GCC"
6880 $ THEN
6881 $   GNUC_REPLACE = "GNUC=gnuc=1"
6882 $ ELSE
6883 $   GNUC_REPLACE = "GNUC=" 
6884 $ ENDIF
6885 $ IF Has_Dec_C_Sockets
6886 $ THEN
6887 $   SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
6888 $ ELSE
6889 $   IF Has_Socketshr
6890 $   THEN
6891 $     SOCKET_REPLACE = "SOCKET=SOCKETSHR_SOCKETS=1"
6892 $   ELSE
6893 $     SOCKET_REPLACE = "SOCKET="
6894 $   ENDIF
6895 $ ENDIF
6896 $ IF use_threads
6897 $ THEN
6898 $   IF (vms_ver .LES. "6.2")
6899 $   THEN
6900 $     THREAD_REPLACE = "THREAD=OLDTHREADED=1"
6901 $   ELSE
6902 $     THREAD_REPLACE = "THREAD=THREADED=1"
6903 $   ENDIF
6904 $ ELSE
6905 $   THREAD_REPLACE = "THREAD="
6906 $ ENDIF
6907 $ IF mymalloc
6908 $ THEN
6909 $   MALLOC_REPLACE = "MALLOC=MALLOC=1"
6910 $ ELSE
6911 $   MALLOC_REPLACE = "MALLOC="
6912 $ ENDIF
6913 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
6914 $ THEN
6915 $   IF usestdstat .or. usestdstat .eqs. "define"
6916 $   THEN
6917 $      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_USE_STD_STAT=1"
6918 $   ELSE
6919 $      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_LARGEFILE=1"
6920 $   ENDIF
6921 $ ELSE
6922 $   LARGEFILE_REPLACE = "LARGEFILE="
6923 $ ENDIF
6924 $!
6925 $! In order not to stress the tiny command buffer on pre-7.3-2 systems,
6926 $! we put the following substitutions in a file and pass the file to
6927 $! munchconfig.
6928 $!
6929 $ open/write CONFIG extra_subs.txt
6930 $ WC := write CONFIG
6931 $ WC "''DECC_REPLACE'"
6932 $ WC "''DECCXX_REPLACE'"
6933 $ WC "''ARCH_TYPE'"
6934 $ WC "''GNUC_REPLACE'"
6935 $ WC "''SOCKET_REPLACE'"
6936 $ WC "''THREAD_REPLACE'"
6937 $ WC "''C_Compiler_Replace'"
6938 $ WC "''MALLOC_REPLACE'"
6939 $ WC "''THREAD_UPCALLS'"
6940 $ WC "''THREAD_KERNEL'"
6941 $ WC "PV=''version'"
6942 $ WC "FLAGS=FLAGS=''extra_flags'"
6943 $ WC "''LARGEFILE_REPLACE'"
6944 $ close CONFIG
6945 $!
6946 $ echo4 "Extracting ''defmakefile' (with variable substitutions)"
6947 $ DEFINE/USER_MODE sys$output 'UUmakefile'
6948 $ mcr []munchconfig 'config_sh' 'Makefile_SH' -f extra_subs.txt
6949 $! Clean up after ourselves
6950 $ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
6951 $ DELETE/NOLOG/NOCONFIRM []extra_subs.txt;
6952 $!
6953 $! Note that the /key qualifier to search, as in:
6954 $! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
6955 $! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
6956 $!
6957 $ echo4 "Extracting extra_pods.com (without variable substitutions)"
6958 $ Create Sys$Disk:[-]extra_pods.com
6959 $ Deck/Dollar="$EOExtra_Pods$"
6960 $!++ extra_pods.com
6961 $!   NOTE: This file is extracted as part of the VMS configuration process.
6962 $!   Any changes made to it directly will be lost.  If you need to make any
6963 $!   changes, please edit the template in Configure.Com instead.
6964 $!   Use FORCE if you've just podified a README.* file on VMS.
6965 $ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
6966     search README.* "=head"/window=0/output=extra.pods
6967 $ open/read/error=extra_close EXTRA extra.pods
6968 $extra_loop:
6969 $ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
6970 $ file_type = f$edit(f$parse(file,,,"TYPE",),"LOWERCASE") - "."
6971 $ if file_type .nes. "VMS" .and. file_type .nes. "vms"
6972 $ then
6973 $   pod_file = "[.pod]perl''file_type'.pod"
6974 $   file = file - "''f$parse(file,,,"VERSION",)'"
6975 $   if p1 .eqs. "CLEAN"
6976 $   then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
6977 $   else
6978 $     do_copy := false
6979 $     if f$search(pod_file) .eqs. ""
6980 $     then do_copy := true
6981 $     else
6982 $       file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
6983 $       pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
6984 $       if file_rdt .GTS. pod_file_rdt then do_copy := true
6985 $     endif
6986 $     ! wacky method to preserve case on ODS-5 even when parse style is traditional
6987 $     if do_copy then mcr sys$disk:[]miniperl.exe -e "exit 0+$^E unless File::Copy::rmscopy(q{''file'}, q{''pod_file'});"
6988 $   endif
6989 $ endif
6990 $ goto extra_loop
6991 $extra_close:
6992 $ close EXTRA
6993 $ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
6994     purge/nolog extra.pods
6995 $!-- extra_pods.com
6996 $EOExtra_Pods$
6997 $!
6998 $!  Warn of dangerous symbols or logical names
6999 $!
7000 $Bad_environment: SUBROUTINE
7001 $   Bad_env = ""
7002 $   IF p2 .eqs. "SYMBOL"
7003 $   THEN
7004 $     IF f$type('p1') .nes. "" THEN  Bad_env := SYMBOL
7005 $   ELSE
7006 $     IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
7007 $   ENDIF
7008 $   IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
7009 $   THEN
7010 $     IF f$search("config.msg") .nes. ""
7011 $     THEN
7012 $       OPEN/APPEND CONFIG config.msg
7013 $     ELSE
7014 $       OPEN/WRITE CONFIG config.msg
7015 $     ENDIF
7016 $     IF Bad_env .eqs. "SYMBOL"
7017 $     THEN
7018 $       WRITE CONFIG ""
7019 $       WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
7020 $       WRITE CONFIG " delete before building ''package' via:"
7021 $       WRITE CONFIG "     $ DELETE/SYMBOL/GLOBAL ''p1'"
7022 $       IF f$locate("""",&p1) .ge. f$length(&p1)
7023 $       THEN
7024 $       WRITE CONFIG " after building, testing, and installing ''package'"
7025 $       WRITE CONFIG " restore the symbol with:"
7026 $       WRITE CONFIG "     $ ''p1' == """ + &p1 + """"
7027 $       ENDIF
7028 $     ENDIF
7029 $     IF Bad_env .eqs. "LOGICAL"
7030 $     THEN
7031 $       WRITE CONFIG ""
7032 $       WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
7033 $       WRITE CONFIG " deassign before building ''package'"
7034 $     ENDIF
7035 $     CLOSE CONFIG
7036 $     Bad_env = ""
7037 $   ENDIF
7038 $ EXIT
7039 $ ENDSUBROUTINE ! Bad_environment
7040 $ echo ""
7041 $ echo4 "Checking for dangerous pre-existing global symbols and logical names."
7042 $ CALL Bad_environment "COMP"
7043 $ CALL Bad_environment "EXT"
7044 $ CALL Bad_environment "FOO"
7045 $ CALL Bad_environment "LIB"
7046 $ CALL Bad_environment "LIST"
7047 $ CALL Bad_environment "MIME"
7048 $ CALL Bad_environment "POSIX"
7049 $ CALL Bad_environment "SYS"
7050 $ CALL Bad_environment "T"
7051 $ CALL Bad_environment "THREAD"
7052 $ CALL Bad_environment "THREADS"
7053 $ CALL Bad_environment "TIME"
7054 $ CALL Bad_environment "TMP"
7055 $ CALL Bad_environment "UNICODE"
7056 $ CALL Bad_environment "UTIL"
7057 $ CALL Bad_environment "TEST" "SYMBOL"
7058 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
7059 $!
7060 $! %Config-I-VMS, write perl_setup.com here
7061 $!
7062 $ IF (.NOT.perl_symbol)
7063 $ THEN
7064 $   file_2_find = "[-]''packageup'.cld"
7065 $   echo ""
7066 $   echo4 "The perl.cld file is now being written..."
7067 $   OPEN/WRITE CONFIG 'file_2_find'
7068 $   ext = ".exe"
7069 $   IF (sharedperl .AND. F$EXTRACT(0,7,archname) .EQS. "VMS_AXP") THEN ext := .AXE
7070 $   IF (sharedperl .AND. F$EXTRACT(0,8,archname) .EQS. "VMS_IA64") THEN ext := .IXE
7071 $   IF (use_vmsdebug_perl)
7072 $   THEN
7073 $     WRITE CONFIG "define verb dbgperl"
7074 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
7075 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7076 $     WRITE CONFIG ""
7077 $     WRITE CONFIG "define verb perl"
7078 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
7079 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7080 $   ELSE
7081 $     WRITE CONFIG "define verb perl"
7082 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
7083 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7084 $   ENDIF
7085 $   CLOSE CONFIG
7086 $ ENDIF ! (.NOT.perl_symbol)
7087 $ echo ""
7088 $ echo4 "The perl_setup.com file is now being written..."
7089 $ file_2_find = "[-]perl_setup.com"
7090 $!
7091 $! Folks are likely to want to edit perl_setup.com.
7092 $! STMLF RFM plays nicer with ported editors than does VFC.
7093 $!
7094 $ CREATE [-]CONFIG.FDL
7095 $ DECK
7096 RECORD
7097   FORMAT STREAM_LF
7098 $ EOD
7099 $ CREATE /FDL=[-]CONFIG.FDL 'file_2_find'
7100 $ OPEN/APPEND CONFIG 'file_2_find'
7101 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;
7102 $ WRITE CONFIG "$!"
7103 $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
7104 $ IF cf_email.NES.perladmin
7105 $ THEN
7106 $ WRITE CONFIG "$! perl configured by ''cf_email'"
7107 $ ELSE
7108 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
7109 $ ENDIF
7110 $ WRITE CONFIG "$!"
7111 $! HP hack to make distributing binaries easier
7112 $!----------------------------------------------
7113 $ pcsi_producer = f$trnlnm("PCSI_PRODUCER")
7114 $ if pcsi_producer .eqs. ""
7115 $ then
7116 $   WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
7117 $ else
7118 $  WRITE CONFIG "$ myproc = f$environment(""PROCEDURE"")"
7119 $  WRITE CONFIG "$ myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
7120 $  WRITE CONFIG "$ myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
7121 $  WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
7122 $  WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
7123 $  WRITE CONFIG "$ myroot_dir = myroot_dir - ""]["" - ""><"""
7124 $  WRITE CONFIG "$ myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
7125 $  WRITE CONFIG "$ if f$trnlnm(""HP_BUILD_PERL_BIN_KIT"",""LNM$PROCESS_TABLE"") .EQS. """""
7126 $  WRITE CONFIG "$ then"
7127 $  WRITE CONFIG "$  define/translation=concealed ''vms_prefix' 'myroot_dev'['myroot_dir'.]"
7128 $  WRITE CONFIG "$ endif"
7129 $ endif
7130 $ WRITE CONFIG "$ ext = "".exe"""
7131 $ IF sharedperl
7132 $ THEN
7133 $ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 2 then ext = "".AXE"""
7134 $ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 3 then ext = "".IXE"""
7135 $ ENDIF
7136 $ IF (perl_symbol)
7137 $ THEN
7138 $   perl_setup_perl = "'" + "'perl'" ! triple quoted foreign command symbol
7139 $   IF (use_vmsdebug_perl)
7140 $   THEN
7141 $     WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgperl'ext'"
7142 $     WRITE CONFIG "$ perl    :== $''vms_prefix':[000000]ndbgperl'ext'"
7143 $     WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
7144 $   ELSE
7145 $     WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
7146 $     WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
7147 $   ENDIF
7148 $ ELSE ! .NOT.perl_symbol
7149 $   perl_setup_perl = "perl" ! command verb
7150 $   IF (use_vmsdebug_perl)
7151 $   THEN
7152 $     WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
7153 $   ELSE
7154 $     WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
7155 $   ENDIF
7156 $   IF perl_verb .EQS. "PROCESS"
7157 $   THEN
7158 $     WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
7159 $   ENDIF
7160 $ ENDIF !  perl_symbol
7161 $!
7162 $ IF (tzneedset)
7163 $ THEN
7164 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7165 $ ELSE    !leave in but commented out (in case setting was from perl :-)
7166 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7167 $ ENDIF
7168 $ WRITE CONFIG "$!"
7169 $ WRITE CONFIG "$! Symbols for Perl-based utility programs:"
7170 $ WRITE CONFIG "$!"
7171 $ WRITE CONFIG "$ c2ph       == """ + perl_setup_perl + " ''vms_prefix':[utils]c2ph.com"""
7172 $ WRITE CONFIG "$ config_data== """ + perl_setup_perl + " ''vms_prefix':[utils]config_data.com"""
7173 $ WRITE CONFIG "$ corelist   == """ + perl_setup_perl + " ''vms_prefix':[utils]corelist.com"""
7174 $ WRITE CONFIG "$ cpan       == """ + perl_setup_perl + " ''vms_prefix':[utils]cpan.com"""
7175 $ WRITE CONFIG "$ cpan2dist  == """ + perl_setup_perl + " ''vms_prefix':[utils]cpan2dist.com"""
7176 $! FIXME: "-" is an operator and illegal in a symbol name -- cpanp-run-perl can't work
7177 $!$ WRITE CONFIG "$ cpanp-run-perl == """ + perl_setup_perl + " ''vms_prefix':[utils]cpanp-run-perl.com"""
7178 $ WRITE CONFIG "$ cpanp      == """ + perl_setup_perl + " ''vms_prefix':[utils]cpanp.com"""
7179 $ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
7180 $ THEN
7181 $ WRITE CONFIG "$ dprofpp    == """ + perl_setup_perl + " ''vms_prefix':[utils]dprofpp.com"""
7182 $ ENDIF 
7183 $ WRITE CONFIG "$ enc2xs     == """ + perl_setup_perl + " ''vms_prefix':[utils]enc2xs.com"""
7184 $ WRITE CONFIG "$ find2perl  == """ + perl_setup_perl + " ''vms_prefix':[utils]find2perl.com"""
7185 $ WRITE CONFIG "$ h2ph       == """ + perl_setup_perl + " ''vms_prefix':[utils]h2ph.com"""
7186 $ WRITE CONFIG "$ h2xs       == """ + perl_setup_perl + " ''vms_prefix':[utils]h2xs.com"""
7187 $ WRITE CONFIG "$ instmodsh  == """ + perl_setup_perl + " ''vms_prefix':[utils]instmodsh.com"""
7188 $ WRITE CONFIG "$ libnetcfg  == """ + perl_setup_perl + " ''vms_prefix':[utils]libnetcfg.com"""
7189 $ WRITE CONFIG "$ perlbug    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlbug.com"""
7190 $ WRITE CONFIG "$ perldoc    == """ + perl_setup_perl + " ''vms_prefix':[utils]perldoc.com """"-t"""""""
7191 $ WRITE CONFIG "$ perlivp    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlivp.com"""
7192 $ WRITE CONFIG "$ piconv     == """ + perl_setup_perl + " ''vms_prefix':[utils]piconv.com"""
7193 $ WRITE CONFIG "$ pl2pm      == """ + perl_setup_perl + " ''vms_prefix':[utils]pl2pm.com"""
7194 $ WRITE CONFIG "$ pod2html   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2html.com"""
7195 $ WRITE CONFIG "$ pod2latex  == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2latex.com"""
7196 $ WRITE CONFIG "$ pod2text   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2text.com"""
7197 $ WRITE CONFIG "$!pod2man    == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2man.com"""
7198 $ WRITE CONFIG "$ pod2usage  == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2usage.com"""
7199 $ WRITE CONFIG "$ podchecker == """ + perl_setup_perl + " ''vms_prefix':[utils]podchecker.com"""
7200 $ WRITE CONFIG "$ podselect  == """ + perl_setup_perl + " ''vms_prefix':[utils]podselect.com"""
7201 $ WRITE CONFIG "$ prove      == """ + perl_setup_perl + " ''vms_prefix':[utils]prove.com"""
7202 $ WRITE CONFIG "$ psed       == """ + perl_setup_perl + " ''vms_prefix':[utils]psed.com"""
7203 $ WRITE CONFIG "$ pstruct    == """ + perl_setup_perl + " ''vms_prefix':[utils]pstruct.com"""
7204 $ WRITE CONFIG "$ s2p        == """ + perl_setup_perl + " ''vms_prefix':[utils]s2p.com"""
7205 $ WRITE CONFIG "$ ptar       == """ + perl_setup_perl + " ''vms_prefix':[utils]ptar.com"""
7206 $ WRITE CONFIG "$ ptardiff   == """ + perl_setup_perl + " ''vms_prefix':[utils]ptardiff.com"""
7207 $ WRITE CONFIG "$ shasum     == """ + perl_setup_perl + " ''vms_prefix':[utils]shasum.com"""
7208 $ WRITE CONFIG "$ splain     == """ + perl_setup_perl + " ''vms_prefix':[utils]splain.com"""
7209 $ WRITE CONFIG "$ xsubpp     == """ + perl_setup_perl + " ''vms_prefix':[utils]xsubpp.com"""
7210 $ CLOSE CONFIG
7211 $!
7212 $ echo  ""
7213 $ echo  "The file can be found at:"
7214 $ echo4 "    ''F$SEARCH(file_2_find)'"
7215 $ echo  "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
7216 $ echo  "when you are satisfied with a successful compilation,"
7217 $ echo  "testing, and installation of your perl."
7218 $ echo  ""
7219 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
7220 $ THEN
7221 $   file_2_find = "[-]''packageup'_install.com"
7222 $   OPEN/WRITE CONFIG 'file_2_find'
7223 $   WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
7224 $   WRITE CONFIG "    /output=sys$common:[syslib]dcltables.exe"
7225 $   WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
7226 $   CLOSE CONFIG
7227 $   echo4 ""
7228 $   echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
7229 $   echo4 "    @ ''F$SEARCH(file_2_find)'"
7230 $   echo4 "after a successful build, test, and install.  Do so with CMKRNL privilege."
7231 $   echo4 ""
7232 $ ENDIF
7233 $!
7234 $!figure out where we "are" by parsing 'vms_default_directory_name' 
7235 $!
7236 $ set_def_command = ""
7237 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
7238 $ tmp = vms_default_directory_name - dflt - "]"
7239 $ i = 0
7240 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
7241 $Set_def_loop:
7242 $ tmp1 = F$ELEMENT(i,".",tmp)
7243 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
7244 $ IF i .EQ. 0 
7245 $ THEN set_def_command = "set default [-"
7246 $ ELSE set_def_command = set_def_command + "-"
7247 $ ENDIF
7248 $ i = i + 1
7249 $ GOTO Set_def_loop
7250 $Beyond_set_def_loop:
7251 $ IF set_def_command.NES.""
7252 $ THEN
7253 $   set_def_command = set_def_command - "-" + "]"
7254 $   echo4 ""
7255 $   echo4 "In order to build ''package' you must now issue the commands:"
7256 $   echo4 ""
7257 $   echo4 " ''set_def_command'"
7258 $ ELSE
7259 $   echo4 ""
7260 $   echo4 "In order to build ''package' you must now issue the command:"
7261 $   echo4 ""
7262 $ ENDIF
7263 $ echo4 " ''make'''makefile'", macros
7264 $ echo4 ""
7265 $!
7266 $ IF ( F$SEARCH("config.msg").NES."" ) 
7267 $ THEN
7268 $   echo4 "Hmm.  I also noted the following information while running:"
7269 $   echo4 ""
7270 $   TYPE/OUTPUT=SYS$ERROR: config.msg
7271 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
7272 $   DELETE/NOLOG/NOCONFIRM config.msg;
7273 $ ENDIF
7274 $!
7275 $Clean_up:
7276 $ SET NOON
7277 $ IF (silent)
7278 $ THEN
7279 $   CLOSE/NOLOG STDOUT
7280 $   DEASSIGN SYS$OUTPUT
7281 $ ENDIF
7282 $ CLOSE/NOLOG CONFIG
7283 $ IF F$GETJPI("","FILCNT").GT.vms_filcnt
7284 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
7285 $ ENDIF
7286 $ dflt = F$ENVIRONMENT("DEFAULT")
7287 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
7288 $ THEN
7289 $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
7290 $   SET DEFAULT [-]
7291 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
7292 $   DELETE/NOLOG/NOCONFIRM UU.DIR;
7293 $ ENDIF
7294 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
7295 $ EXIT
7296 $!: End of Configure