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