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