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