This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Promote v5.36 usage and feature bundles doc
[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=some value"  symbol is set to "some 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. You may enter "none" for no administrator.
1874 $   EOD
1875 $ ENDIF
1876 $ dflt = "''cf_email'"
1877 $ rp = "Perl administrator e-mail address [''dflt'] "
1878 $ GOSUB myread
1879 $ perladmin = ans
1880 $!
1881 $!: determine where public executable scripts go
1882 $!: determine perl absolute location
1883 $!: figure out how to guarantee perl startup
1884 $!
1885 $!: see how we invoke the C preprocessor
1886 $! echo ""
1887 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1888 $!: Set private lib path
1889 $!: Now check and see which directories actually exist, avoiding duplicates
1890 $!: determine optimize, if desired, or use for debug flag also
1891 $!: We will not override a previous value, but we might want to
1892 $!: augment a hint file
1893 $!: the following weeds options from ccflags that are of no interest to cpp
1894 $!: flags used in final linking phase
1895 $!: Try to guess additional flags to pick up local libraries.
1896 $!: coherency check
1897 $! echo ""
1898 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1899 $!: compute shared library extension
1900 $!: Looking for optional libraries
1901 $!: see if nm is to be used to determine whether a symbol is defined or not
1902 $!: get list of predefined functions in a handy place
1903 $!: see if we have sigaction or sigprocmask
1904 $ IF (ccname .EQS. "DEC" .AND. Dec_C_Version .GE. 50200000) .OR. (ccname .EQS. "CXX")
1905 $ THEN
1906 $   Has_Dec_C_Sockets = "T"
1907 $   echo ""
1908 $   echo4 "Hmm... Looks like you have Dec C Berkeley networking support."
1909 $ ELSE
1910 $   Has_Dec_C_Sockets = "F"
1911 $ ENDIF
1912 $!
1913 $ IF Has_Dec_C_Sockets
1914 $ THEN
1915 $   echo ""
1916 $   echo "You have sockets available via the C library. Should socket support"
1917 $   echo "be built into Perl?"
1918 $   dflt = "DECC"
1919 $   rp = "Choose socket support option (NONE"
1920 $   IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
1921 $   rp = rp + ") [''dflt'] "
1922 $   GOSUB myread
1923 $   Has_Dec_C_Sockets = "F"
1924 $   Has_socketshr = "F"
1925 $   ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1926 $   IF ans.eqs."decc" THEN Has_Dec_C_Sockets = "T"
1927 $ ENDIF
1928 $!
1929 $!
1930 $! Ask if they want to build with VMS_DEBUG perl
1931 $ echo ""
1932 $ echo "Perl can be built to run under the VMS debugger."
1933 $ echo "You should only select this option if you are debugging"
1934 $ echo "perl itself.  This can be a useful feature if you are "
1935 $ echo "embedding perl in a program."
1936 $ bool_dflt = "n"
1937 $ if f$type(usevmsdebug) .nes. "" 
1938 $ then
1939 $   if usevmsdebug .or. usevmsdebug .eqs. "define" then bool_dflt="y"
1940 $ endif
1941 $ rp = "Build a VMS-DEBUG version of Perl? [''bool_dflt'] "
1942 $ GOSUB myread
1943 $ use_vmsdebug_perl = ans
1944 $ IF use_vmsdebug_perl
1945 $ THEN
1946 $   usevmsdebug = "define"
1947 $ ELSE
1948 $   usevmsdebug = "undef"
1949 $ ENDIF
1950 $!
1951 $! Ask if they want to build with DEBUGGING
1952 $ echo ""
1953 $ echo "Perl can be built with extra runtime debugging enabled. This"
1954 $ echo "enables the -D switch, at the cost of some performance.  It"
1955 $ echo "was mandatory on perl 5.005 and before on VMS, but is now"
1956 $ echo "optional.  If you do not generally use it you should probably"
1957 $ echo "leave this off and gain a bit of extra speed."
1958 $ bool_dflt = "n"
1959 $ if f$type(DEBUGGING) .nes. "" 
1960 $ then
1961 $   if f$extract(0,1,f$edit(DEBUGGING,"collapse,upcase")).eqs."Y"  .or. DEBUGGING .eqs. "define" then bool_dflt="y"
1962 $ endif
1963 $ rp = "Build a DEBUGGING version of Perl? [''bool_dflt'] "
1964 $ GOSUB myread
1965 $ use_debugging_perl = ans
1966 $!
1967 $!
1968 $! Ask about threads, if appropriate
1969 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
1970 $ THEN
1971 $   echo ""
1972 $   echo "Perl can be built to offer a form of threading support on some systems."
1973 $   echo "To do so, configure.com can be run with -""Dusethreads""."
1974 $   echo ""
1975 $   echo "Note that Perl built with threading support runs slightly slower"
1976 $   echo "and uses slightly more memory than plain Perl."
1977 $   echo ""
1978 $   bool_dflt = "n"
1979 $   if f$type(usethreads) .nes. "" 
1980 $   then 
1981 $       if usethreads .or. usethreads .eqs. "define" then bool_dflt="y"
1982 $   endif
1983 $!  Catch cases where user specified ithreads but
1984 $!  forgot -Dusethreads 
1985 $   if f$type(useithreads) .nes. ""
1986 $   then
1987 $         if useithreads .or. useithreads .eqs. "define" then bool_dflt="y"
1988 $   endif
1989 $   echo "If this doesn't make any sense to you, just accept the default '" + bool_dflt + "'."
1990 $   rp = "Build a threading Perl? [''bool_dflt'] "
1991 $   GOSUB myread
1992 $   if ans
1993 $   THEN
1994 $     usethreads = "define"
1995 $     use_threads="T"
1996 $     bool_dflt = "y"
1997 $     if f$type(useithreads) .nes. ""
1998 $     then
1999 $         if useithreads .eqs. "undef" then bool_dflt="n"
2000 $     endif
2001 $     rp = "Use the newer interpreter-based ithreads? [''bool_dflt'] "
2002 $     GOSUB myread
2003 $     use_ithreads=ans
2004 $     ! Are they on VMS 7.1 or greater?
2005 $     IF "''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.1"
2006 $     THEN
2007 $       echo ""
2008 $       echo "Threaded Perl can be linked to use system upcalls on your system. This feature"
2009 $       echo "allows the thread scheduler to be made aware of system events (such as I/O)"
2010 $       echo "so as to prevent a single thread from blocking all the threads in a program,"
2011 $       echo "even on a single-processor machine."
2012 $       bool_dflt = "y"
2013 $       IF f$type(usethreadupcalls) .NES. ""
2014 $       THEN
2015 $               if .not. usethreadupcalls .or. usethreadupcalls .eqs. "undef" then bool_dflt="n"
2016 $       ENDIF
2017 $       rp = "Enable thread upcalls? [''bool_dflt'] "
2018 $       gosub myread
2019 $       IF ans
2020 $       THEN
2021 $           thread_upcalls = "MTU=MTU=1"
2022 $           usethreadupcalls = "define"
2023 $           ! Are they on alpha or itanium?
2024 $           IF ("''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.2")
2025 $           THEN
2026 $               echo ""
2027 $               echo "Threaded Perl can be linked to use multiple kernel threads on your system."
2028 $               echo "This feature allows multiple user threads to make use of multiple CPUs on"
2029 $               echo "a multi-processor machine."
2030 $               bool_dflt = "n"
2031 $               IF f$type(usekernelthreads) .nes. ""
2032 $               THEN
2033 $                       if usekernelthreads .or. usekernelthreads .eqs. "define" then bool_dflt="y"
2034 $               ENDIF
2035 $               rp = "Enable multiple kernel threads? [''bool_dflt'] "
2036 $               gosub myread
2037 $               IF ans
2038 $               THEN
2039 $                   thread_kernel = "MTK=MTK=1"
2040 $                   usekernelthreads = "define"
2041 $               ENDIF
2042 $           ENDIF
2043 $       ENDIF
2044 $     ENDIF
2045 $   ELSE
2046 $     usethreads = "undef"
2047 $   ENDIF
2048 $ ELSE
2049 $   usethreads = "undef"
2050 $ ENDIF
2051 $ IF F$TYPE(usethreadupcalls) .EQS. "" THEN usethreadupcalls = "undef"
2052 $ IF F$TYPE(usekernelthreads) .EQS. "" THEN usekernelthreads = "undef"
2053 $!
2054 $! Ask if they want to build with MULTIPLICITY
2055 $ echo ""
2056 $ echo "Perl can be built so that multiple Perl interpreters can coexist"
2057 $ echo "within the same Perl executable."
2058 $ IF usethreads .OR. usethreads .EQS. "define"
2059 $ THEN
2060 $   echo "This multiple interpreter support is required for interpreter-based threads."
2061 $   usemultiplicity="define"
2062 $ ELSE
2063 $   bool_dflt = "n"
2064 $   if f$type(usemultiplicity) .nes. "" 
2065 $   then
2066 $     if usemultiplicity .or. usemultiplicity .eqs. "define" then bool_dflt = "y"
2067 $   endif
2068 $   rp = "Build Perl for multiplicity? [''bool_dflt'] "
2069 $   GOSUB myread
2070 $   IF ans
2071 $   THEN
2072 $     usemultiplicity="define"
2073 $   ELSE
2074 $     usemultiplicity="undef"
2075 $   ENDIF
2076 $ ENDIF
2077 $!
2078 $! Ask if they want to build with 64-bit support
2079 $ bool_dflt = "n"
2080 $ IF F$TYPE(use64bitint) .NES. ""
2081 $ THEN
2082 $   IF use64bitint .OR. use64bitint .eqs. "define" THEN bool_dflt = "y"
2083 $ ENDIF
2084 $ echo ""
2085 $ echo "You have natively 64-bit long integers."
2086 $ echo ""
2087 $ echo "Perl can be built to take advantage of 64-bit integer types"
2088 $ echo "on some systems, To do so, Configure can be run with -Duse64bitint."
2089 $ echo "Choosing this option will most probably introduce binary incompatibilities."
2090 $ echo ""
2091 $ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2092 $ rp = "Try to use 64-bit integers, if available? [''bool_dflt'] "
2093 $ GOSUB myread
2094 $ use64bitint = ans
2095 $!
2096 $ bool_dflt = "n"
2097 $ IF F$TYPE(use64bitall) .NES. ""
2098 $ THEN
2099 $   IF use64bitall .OR. use64bitall .eqs. "define" THEN bool_dflt = "y"
2100 $ ENDIF
2101 $ echo ""
2102 $ echo "You may also choose to try maximal 64-bitness.  It means using as much"
2103 $ echo "64-bitness as possible on the platform.  This in turn means even more"
2104 $ echo "binary incompatibilities.  On the other hand, your platform may not"
2105 $ echo "have any more 64-bitness available than what you already have chosen."
2106 $ echo ""
2107 $ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2108 $ rp = "Try to use maximal 64-bit support, if available? [''bool_dflt'] "
2109 $ GOSUB myread
2110 $ use64bitall=ans
2111 $ IF use64bitall .AND. .NOT. use64bitint
2112 $ THEN
2113 $   echo ""
2114 $   echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
2115 $   echo "the use of 64-bit integers."
2116 $   use64bitint="Y"
2117 $ ENDIF
2118 $!
2119 $ bool_dflt = use64bitall
2120 $ IF F$TYPE(uselargefiles) .NES. "" 
2121 $ THEN
2122 $   IF uselargefiles .OR. uselargefiles .eqs. "define" THEN bool_dflt = "y"
2123 $ ENDIF
2124 $ echo ""
2125 $ echo "Perl can be built to understand large files (files larger than 2 gigabytes)"
2126 $ echo "on some systems.  To do so, Configure can be run with -Duselargefiles."
2127 $ echo ""
2128 $ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2129 $ rp = "Try to understand large files, if available? [''bool_dflt'] "
2130 $ GOSUB myread
2131 $ uselargefiles=ans
2132 $!
2133 $ bool_dflt = "n"
2134 $ IF F$TYPE(uselongdouble) .NES. ""
2135 $ THEN
2136 $   IF uselongdouble .OR. uselongdouble .eqs. "define" THEN bool_dflt = "y"
2137 $ ENDIF
2138 $ echo ""
2139 $ echo "Perl can be built to take advantage of long doubles which"
2140 $ echo "(if available) may give more accuracy and range for floating point numbers."
2141 $ echo ""
2142 $ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2143 $ rp = "Try to use long doubles, if available? [''bool_dflt'] "
2144 $ GOSUB myread
2145 $ uselongdouble = ans
2146 $!
2147 $!
2148 $ IF usesitecustomize .OR. usesitecustomize .eqs. "define" 
2149 $ THEN 
2150 $   usesitecustomize = "define"
2151 $ ELSE
2152 $   usesitecustomize = "undef"
2153 $ ENDIF
2154 $!
2155 $! Case sensitive?
2156 $ echo ""
2157 $ echo "By default, perl (and pretty much everything else on VMS) uses"
2158 $ echo "case-insensitive linker symbols. Which is to say, when the"
2159 $ echo "underlying C code makes a call to a routine called Perl_foo in"
2160 $ echo "the source, the name in the object modules or shareable images"
2161 $ echo "is really PERL_FOO. There are some packages that use an"
2162 $ echo "embedded perl interpreter that instead require case-sensitive"
2163 $ echo "linker symbols."
2164 $ echo ""
2165 $ echo "If you have no idea what this means, and do not have"
2166 $ echo "any program requiring anything, choose the default."
2167 $ bool_dflt = be_case_sensitive
2168 $ if f$type(usecasesensitive) .nes. ""
2169 $ then
2170 $   if usecasesensitive .or. usecasesensitive .eqs. "define" then bool_dflt = "y"
2171 $   if f$extract(0,1,f$edit(usecasesensitive,"collapse,upcase")).eqs."N" .or. usecasesensitive .eqs. "undef"  then bool_dflt = "n"
2172 $ endif
2173 $ rp = "Build with case-sensitive symbols? [''bool_dflt'] "
2174 $ GOSUB myread
2175 $ be_case_sensitive = ans
2176 $!
2177 $! Shortened symbols?
2178 $   echo ""
2179 $   echo "The VMS linker does not handle symbol names longer than 31 characters,"
2180 $   echo "but the compiler can shorten long symbols if requested."
2181 $   bool_dflt = shorten_long_symbols
2182 $   if f$type(useshortenedsymbols) .nes. ""
2183 $   then
2184 $       if useshortenedsymbols .or. useshortenedsymbols .eqs. "define" then bool_dflt = "y"
2185 $       if f$extract(0,1,f$edit(useshortenedsymbols,"collapse,upcase")) .eqs. "N" .or. useshortenedsymbols .eqs. "undef"  then bool_dflt = "n"
2186 $   endif
2187 $   rp = "Build with long symbols shortened? [''bool_dflt'] "
2188 $   GOSUB myread
2189 $   shorten_long_symbols = ans
2190 $! IEEE math?
2191 $ echo ""
2192 $ echo "Perl normally uses IEEE format (T_FLOAT) floating point numbers on"
2193 $ echo "Alpha and Itanium, but if you need G_FLOAT for binary compatibility"
2194 $ echo "with an external library or existing data, you may wish to disable"
2195 $ echo "the IEEE math option."
2196 $ bool_dflt = use_ieee_math
2197 $ if f$type(useieee) .nes. ""
2198 $ then
2199 $   if useieee .or. useieee .eqs. "define"
2200 $   then
2201 $     bool_dflt="y"
2202 $   else
2203 $     bool_dflt="n"
2204 $   endif
2205 $ endif
2206 $ rp = "Use IEEE math? [''bool_dflt'] "
2207 $ GOSUB myread
2208 $ use_ieee_math = ans
2209 $ useieee = "undef"
2210 $ usecasesensitive = "undef"
2211 $ useshortenedsymbols = "undef"
2212 $ if (use_ieee_math) then useieee = "define"
2213 $ if (be_case_sensitive) then usecasesensitive = "define"
2214 $ if (shorten_long_symbols) then useshortenedsymbols = "define"
2215 $! Unlink all versions?
2216 $ echo ""
2217 $ echo "By default, Perl's unlink() provides VMS-like behavior and only"
2218 $ echo "deletes the latest version of a file.  Enabling this option builds"
2219 $ echo "Perl so that unlink() deletes all versions of a file."
2220 $ bool_dflt = unlink_all_versions
2221 $ if f$type(unlink_all_versions) .nes. ""
2222 $ then
2223 $       if unlink_all_versions .or. unlink_all_versions .eqs. "define"
2224 $       then
2225 $         bool_dflt="y"
2226 $       else
2227 $         bool_dflt="n"
2228 $       endif
2229 $ endif
2230 $ rp = "Make unlink() delete all versions of a file? [''bool_dflt'] "
2231 $ GOSUB myread
2232 $ unlink_all_versions = ans
2233 $ IF unlink_all_versions
2234 $ THEN
2235 $     d_unlink_all_versions = "define"
2236 $ ELSE
2237 $     d_unlink_all_versions = "undef"
2238 $ ENDIF
2239 $!
2240 $! CC Flags
2241 $ echo ""
2242 $ echo "Your compiler may want other flags.  For this question you should include"
2243 $ echo "/INCLUDE=(whatever) and /DEFINE=(whatever), flags and any other flags"
2244 $ echo "or qualifiers used by the compiler."
2245 $ echo ""
2246 $ echo "To use no flags, specify the word ""none""."
2247 $ dflt = user_c_flags
2248 $ rp = "Any additional cc flags? [''dflt'] "
2249 $ GOSUB myread
2250 $ IF ans .EQS. "none" THEN ans = ""
2251 $ user_c_flags = "''ans'"
2252 $!
2253 $! Ask whether they want to use secure logical translation when tainting
2254 $ echo ""
2255 $ echo "As Perl starts up, it checks several logical names, such as"
2256 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
2257 $ echo "of its behavior.  For additional security, you may limit this"
2258 $ echo "process to executive- and kernel-mode translation when tainting"
2259 $ echo "is enabled.  In this case, logical names normally skipped when"
2260 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
2261 $ echo "If you do not choose to do this, the usual order of access modes"
2262 $ echo "is used for logical name translation."
2263 $ echo ""
2264 $ echo "This restriction does not apply to the %ENV hash or to implicit"
2265 $ echo "logical name translation during parsing of file specifications;"
2266 $ echo "these always use the normal sequence of access modes for logical"
2267 $ echo "name translation."
2268 $ bool_dflt = "y"
2269 $ if f$type(usesecurelog) .nes. "" 
2270 $ then
2271 $   if f$extract(0,1,f$edit(usesecurelog,"collapse,upcase")).eqs."N" .or. usesecurelog .eqs. "undef" then bool_dflt = "n"
2272 $ endif
2273 $ rp = "Use secure logical name translation? [''bool_dflt'] "
2274 $ GOSUB myread
2275 $ d_secintgenv  = ans
2276 $ usesecurelog = "undef"
2277 $ if (d_secintgenv) then usesecurelog = "define"
2278 $!
2279 $! Ask whether they want to default filetypes
2280 $ echo ""
2281 $ echo "When you pass the name of a program to Perl on the command line,"
2282 $ echo "it generally doesn't supply any defaults unless the -S command"
2283 $ echo "line switch is specified.  In keeping with the VMS tradition of"
2284 $ echo "default file types, however, you can configure Perl to try default"
2285 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
2286 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
2287 $ echo "finally foo.com)."
2288 $ echo ""
2289 $ echo "This is currently broken in some configurations. Only enable it if"
2290 $ echo "you know what you are doing."
2291 $ bool_dflt = "n"
2292 $ if f$type(usedefaulttypes) .nes. "" 
2293 $ then
2294 $     if usedefaulttypes .or. usedefaulttypes .eqs. "define" then bool_dflt="y"
2295 $ endif
2296 $ rp = "Always use default file types? [''bool_dflt'] "
2297 $ GOSUB myread
2298 $ d_alwdeftype = ans
2299 $ usedefaulttypes = "undef"
2300 $ if (d_alwdeftype) then usedefaulttypes = "define"
2301 $!
2302 $ dflt = archname
2303 $ rp = "What is your architecture name? [''archname'] "
2304 $ GOSUB myread
2305 $ IF ans.NES.""
2306 $ THEN
2307 $   ans = F$EDIT(ans,"COLLAPSE, UPCASE")
2308 $   IF (ans.NES.archname) !.AND.knowitall
2309 $   THEN
2310 $     echo4 "I'll go with ''archname' anyway..."
2311 $   ENDIF
2312 $ ENDIF
2313 $!
2314 $ bool_dflt = "n"
2315 $ if f$type(useversionedarchname) .nes. ""
2316 $ then
2317 $   if useversionedarchname .or. useversionedarchname .eqs. "define" then bool_dflt = "y"
2318 $ endif
2319 $ rp = "Add the Perl API version to your archname? [''bool_dflt'] "
2320 $ GOSUB myread
2321 $ IF ans
2322 $ THEN
2323 $   useversionedarchname = "define"
2324 $   IF F$LOCATE("-''version'", archname) .EQ. F$LENGTH(archname)
2325 $   THEN
2326 $     archname = "''archname'-''version'"
2327 $     echo4 "...setting architecture name to ''archname'."
2328 $   ELSE
2329 $     echo4 "...and architecture name already has -''version'."
2330 $   ENDIF
2331 $ ELSE
2332 $   useversionedarchname = "undef"
2333 $ ENDIF
2334 $!
2335 $ IF usethreads .OR. usethreads .EQS. "define"
2336 $ THEN
2337 $   echo4 "Threads selected."
2338 $   IF F$LOCATE("-thread", archname) .EQ. F$LENGTH(archname)
2339 $   THEN
2340 $     archname = "''archname'-thread"
2341 $     echo4 "...setting architecture name to ''archname'."
2342 $   ELSE
2343 $     echo4 "...and architecture name already has -thread."
2344 $   ENDIF
2345 $ ENDIF
2346 $!
2347 $ IF usemultiplicity .OR. usemultiplicity .EQS. "define"
2348 $ THEN
2349 $   echo4 "Multiplicity selected."
2350 $   IF F$LOCATE("-multi", archname) .EQ. F$LENGTH(archname)
2351 $   THEN
2352 $     archname = "''archname'-multi"
2353 $     echo4 "...setting architecture name to ''archname'."
2354 $   ELSE
2355 $     echo4 "...and architecture name already has -multi."
2356 $   ENDIF
2357 $ ENDIF
2358 $!
2359 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
2360 $ THEN
2361 $   echo4 "Long doubles selected."
2362 $   IF F$LOCATE("-ld", archname) .EQ. F$LENGTH(archname)
2363 $   THEN
2364 $     archname = "''archname'-ld"
2365 $     echo4 "...setting architecture name to ''archname'."
2366 $   ELSE
2367 $     echo4 "...and architecture name already has -ld."
2368 $   ENDIF
2369 $ ENDIF
2370 $!
2371 $ bool_dflt = "n"
2372 $ vms_prefix = "perl_root"
2373 $ vms_prefixup = F$EDIT(vms_prefix,"UPCASE")
2374 $ rp = "Will you be sharing your ''vms_prefixup' with ''otherarch'? [''bool_dflt'] "
2375 $ GOSUB myread
2376 $ IF .NOT. ans
2377 $ THEN
2378 $   sharedperl = "N"
2379 $ ELSE
2380 $   sharedperl = "Y"
2381 $   IF (F$ELEMENT(0, "-", archname).EQS."VMS_AXP")
2382 $   THEN
2383 $     macros = macros + """AXE=1"","
2384 $   ENDIF
2385 $   IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
2386 $   THEN
2387 $     macros = macros + """IXE=1"","
2388 $   ENDIF
2389 $ ENDIF
2390 $!
2391 $!: is AFS running?                       !sfn
2392 $!: decide how portable to be.  Allow command line overrides. !sfn
2393 $!: set up shell script to do ~ expansion !sfn
2394 $!: expand filename                       !sfn
2395 $!: now set up to get a file name         !sfn
2396 $!
2397 $ IF F$TYPE(prefix) .EQS. ""
2398 $ THEN
2399 $   prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
2400 $   prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - "000000." - ".000000" - ".;"
2401 $   prefixbase = prefix - "]"
2402 $!  Add _ROOT to make install PERL_ROOT differ from build directory.
2403 $   prefix = prefixbase + "_ROOT.]"
2404 $ ENDIF
2405 $ ! more redundant scrubbing of values
2406 $ prefix = prefix - "000000."
2407 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
2408 $ src = prefix - "_ROOT."
2409 $!: determine root of directory hierarchy where package will be installed.
2410 $ dflt = prefix
2411 $ IF .NOT.silent 
2412 $ THEN 
2413 $   echo ""
2414 $   echo "By default, ''package' will be installed in ''dflt', pod"
2415 $   echo "pages under ''prefixbase'.LIB.POD], etc..., i.e. with ''dflt' as prefix for"
2416 $   echo "all installation directories."
2417 $   echo "On ''osname' the prefix is used to DEFINE the ''vms_prefixup' prior to installation"
2418 $   echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
2419 $ ENDIF
2420 $ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
2421 $ GOSUB myread
2422 $ IF ans.NES.""
2423 $ THEN 
2424 $   prefix = ans
2425 $   IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
2426 $ ELSE 
2427 $   prefix = dflt
2428 $ ENDIF
2429 $ perl_root = prefix
2430 $!
2431 $! Check here for pre-existing PERL_ROOT.
2432 $!  -> ask if removal desired.
2433 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
2434 $!  -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
2435 $!
2436 $   tmp = perl_root - ".]" + "]"
2437 $ dflt = f$parse(tmp,,,,)
2438 $   IF dflt .eqs. ""
2439 $   THEN
2440 $       echo4 "''tmp' does not yet exist."
2441 $!      create/directory 'tmp'
2442 $   ELSE
2443 $       echo4 "''tmp' already exists."
2444 $   ENDIF
2445 $!
2446 $ vms_skip_install = "true"
2447 $ bool_dflt = "y"
2448 $! echo ""
2449 $ rp = "Skip the remaining """"where install"""" questions? [''bool_dflt'] "
2450 $ GOSUB myread
2451 $ IF (.NOT.ans) THEN vms_skip_install = "false"
2452 $ IF (.NOT.vms_skip_install)
2453 $ THEN
2454 $!
2455 $!: set the prefixit variable, to compute a suitable default value
2456 $!
2457 $!: determine where private library files go
2458 $!: Usual default is /usr/local/lib/perl5.  Also allow things like 
2459 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2460 $   IF .NOT.silent 
2461 $   THEN
2462 $     TYPE SYS$INPUT:
2463 $     DECK
2464
2465 There are some auxiliary files for perl5 that need to be put into a
2466 private library directory that is accessible by everyone.
2467 $     EOD
2468 $   ENDIF
2469 $   IF F$TYPE(privlib) .NES. ""
2470 $   THEN dflt = privlib
2471 $   ELSE dflt = "/''vms_prefix'/lib"
2472 $   ENDIF
2473 $   rp = "Pathname where the private library files will reside? " 
2474 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2475 $   GOSUB myread
2476 $   privlib = ans
2477 $!
2478 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
2479 $!
2480 $ IF F$TYPE(perl_symbol) .EQS. "" THEN perl_symbol := true
2481 $ IF F$TYPE(perl_verb) .EQS. "" THEN perl_verb = ""
2482 $ IF perl_symbol
2483 $ THEN bool_dflt = "y"
2484 $ ELSE bool_dflt = "n"
2485 $ ENDIF
2486 $ IF .NOT.silent 
2487 $ THEN 
2488 $   echo ""
2489 $   echo "You may choose to write ''packageup'_SETUP.COM to assign a foreign"
2490 $   echo "symbol to invoke ''package', which is the usual method."
2491 $   echO "If you do not do so then you would need a DCL command verb at the"
2492 $   echo "process or the system wide level."
2493 $ ENDIF
2494 $ rp = "Invoke perl as a global symbol foreign command? [''bool_dflt'] "
2495 $ GOSUB myread
2496 $ IF (.NOT.ans) THEN perl_symbol = "false"
2497 $!
2498 $ IF (.NOT.perl_symbol)
2499 $ THEN
2500 $   IF perl_verb .EQS. "DCLTABLES"
2501 $   THEN bool_dflt = "n"
2502 $   ELSE bool_dflt = "y"
2503 $   ENDIF
2504 $   IF .NOT.silent 
2505 $   THEN 
2506 $     echo ""
2507 $     echo "Since you won't be using a symbol you must choose to put the ''packageup'"
2508 $     echo "verb in a per-process table or in the system wide DCLTABLES (which"
2509 $     echo "would require write privilege)."
2510 $   ENDIF
2511 $   rp = "Invoke perl as a per process command verb? [ ''bool_dflt' ] "
2512 $   GOSUB myread
2513 $   IF (.NOT.ans)
2514 $   THEN perl_verb = "DCLTABLES"
2515 $   ELSE perl_verb = "PROCESS"
2516 $   ENDIF
2517 $ ENDIF ! (.NOT.perl_symbol)
2518 $!
2519 $ IF (.NOT.vms_skip_install)
2520 $ THEN
2521 $!: set the prefixup variable, to restore leading tilde escape !sfn
2522 $!
2523 $!: determine where public architecture dependent libraries go
2524 $   IF (.NOT.silent) 
2525 $   THEN 
2526 $     echo ""
2527 $     echo "''package' contains architecture-dependent library files.  If you are"
2528 $   ENDIF
2529 $   IF (.NOT.silent) 
2530 $   THEN
2531 $     TYPE SYS$INPUT:
2532 $     DECK
2533 sharing libraries in a heterogeneous environment, you might store
2534 these files in a separate location.  Otherwise, you can just include
2535 them with the rest of the public library files.
2536 $     EOD
2537 $   ENDIF
2538 $   IF F$TYPE(archlib) .NES. ""
2539 $   THEN dflt = archlib
2540 $   ELSE dflt = privlib + "/" + archname + "/" + version
2541 $   ENDIF
2542 $   rp = "Where do you want to put the public architecture-dependent libraries? "
2543 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2544 $   GOSUB myread
2545 $   archlib = ans
2546 $!
2547 $ ENDIF !%Config-I-VMS, skip "where install" questions
2548 $ IF (.NOT.vms_skip_install)
2549 $ THEN
2550 $!: it so happens the Eunice I know will not run shell scripts in Unix format
2551 $!
2552 $!: see if setuid scripts can be secure           !sfn
2553 $!: now see if they want to do setuid emulation   !sfn
2554 $!
2555 $!: determine where site specific libraries go.
2556 $   IF .NOT.silent 
2557 $   THEN
2558 $     TYPE SYS$INPUT:
2559 $     DECK
2560
2561 The installation process will also create a directory for
2562 site-specific extensions and modules.  Some users find it convenient
2563 to place all local files in this directory rather than in the main
2564 distribution directory.
2565 $     EOD
2566 $   ENDIF
2567 $   IF F$TYPE(sitelib) .NES. ""
2568 $   THEN dflt = sitelib
2569 $   ELSE dflt = privlib + "/site_perl"
2570 $   ENDIF
2571 $   rp = "Pathname for the site-specific library files? "
2572 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2573 $   GOSUB myread
2574 $   sitelib = ans
2575 $!
2576 $!: determine where site specific architecture-dependent libraries go.
2577 $   IF .NOT.silent 
2578 $   THEN TYPE SYS$INPUT:
2579 $     DECK
2580
2581 The installation process will also create a directory for
2582 architecture-dependent site-specific extensions and modules.
2583 $     EOD
2584 $   ENDIF
2585 $   IF F$TYPE(sitearch) .NES. ""
2586 $   THEN dflt = sitearch
2587 $   ELSE dflt = sitelib + "/" + archname
2588 $   ENDIF
2589 $   rp = "Pathname for the site-specific architecture-dependent library files? "
2590 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2591 $   GOSUB myread
2592 $   sitearch = ans
2593 $!
2594 $!: determine where old public architecture dependent libraries might be
2595 $!
2596 $!: determine where public executables go
2597 $   IF F$TYPE(bin) .NES. ""
2598 $   THEN dflt = bin
2599 $   ELSE dflt = "/''vms_prefix'"
2600 $   ENDIF
2601 $   rp = "Pathname where the public executables will reside? "
2602 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2603 $   GOSUB myread
2604 $   bin = ans
2605 $!
2606 $!: determine where add-on public executables go
2607 $   IF F$TYPE(sitebin) .NES. ""
2608 $   THEN dflt = sitebin
2609 $   ELSE dflt = "/''vms_prefix'/bin/''archname'"
2610 $   ENDIF
2611 $   rp = "Pathname where the add-on public executables should be installed? "
2612 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2613 $   GOSUB myread
2614 $   sitebin = ans
2615 $!
2616 $!: determine where manual pages are on this system
2617 $!: What suffix to use on installed man pages
2618 $!: see if we can have long filenames
2619 $!: determine where library module manual pages go
2620 $!: What suffix to use on installed man pages
2621 $!: see what memory models we can support
2622 $!
2623 $ ELSE ! skipping "where install" questions, we must set some symbols
2624 $   IF F$TYPE(archlib).EQS."" THEN -
2625       archlib="/''vms_prefix'/lib/''archname'/''version'"
2626 $   IF F$TYPE(bin) .EQS. "" THEN -
2627       bin="/''vms_prefix'"
2628 $   IF F$TYPE(privlib) .EQS. "" THEN -
2629       privlib ="/''vms_prefix'/lib"
2630 $   IF F$TYPE(sitearch) .EQS. "" THEN -
2631       sitearch="/''vms_prefix'/lib/site_perl/''archname'"
2632 $   IF F$TYPE(sitelib) .EQS. "" THEN -
2633       sitelib ="/''vms_prefix'/lib/site_perl"
2634 $   IF F$TYPE(sitebin) .EQS. "" THEN -
2635       sitebin="/''vms_prefix'/bin/''archname'"
2636 $ ENDIF !%Config-I-VMS, skip "where install" questions
2637 $!
2638 $! These derived locations can be set whether we've opted to
2639 $! skip the where install questions or not.
2640 $!
2641 $ IF F$TYPE(archlibexp) .EQS. "" THEN -
2642     archlibexp="/''vms_prefix'/lib/''archname'/''version'"
2643 $ IF F$TYPE(binexp) .EQS. "" THEN -
2644     binexp ="/''vms_prefix'"
2645 $ IF F$TYPE(builddir) .EQS. "" THEN -
2646     builddir ="/''vms_prefix'"
2647 $ IF F$TYPE(installarchlib) .EQS. "" THEN -
2648     installarchlib="/''vms_prefix'/lib/''archname'/''version'"
2649 $ IF F$TYPE(installbin) .EQS. "" THEN -
2650     installbin ="/''vms_prefix'"
2651 $ IF F$TYPE(installscript) .EQS. "" THEN -
2652     installscript ="/''vms_prefix'/utils"
2653 $ IF F$TYPE(installman1dir) .EQS. "" THEN -
2654     installman1dir ="/''vms_prefix'/man/man1"
2655 $ IF F$TYPE(installman3dir) .EQS. "" THEN -
2656     installman3dir ="/''vms_prefix'/man/man3"
2657 $ IF F$TYPE(installprivlib) .EQS. "" THEN -
2658     installprivlib ="/''vms_prefix'/lib"
2659 $ IF F$TYPE(installsitearch) .EQS. "" THEN -
2660     installsitearch="/''vms_prefix'/lib/site_perl/''archname'"
2661 $ IF F$TYPE(installsitelib) .EQS. "" THEN -
2662     installsitelib ="/''vms_prefix'/lib/site_perl"
2663 $ IF F$TYPE(oldarchlib) .EQS. "" THEN -
2664     oldarchlib="/''vms_prefix'/lib/''archname'"
2665 $ IF F$TYPE(oldarchlibexp) .EQS. "" THEN -
2666     oldarchlibexp="/''vms_prefix'/lib/''archname'"
2667 $ IF F$TYPE(privlibexp) .EQS. "" THEN -
2668     privlibexp ="/''vms_prefix'/lib"
2669 $ IF F$TYPE(scriptdir) .EQS. "" THEN -
2670     scriptdir ="/''vms_prefix'/utils"
2671 $ IF F$TYPE(sitearchexp) .EQS. "" THEN -
2672     sitearchexp ="/''vms_prefix'/lib/site_perl/''archname'"
2673 $ IF F$TYPE(sitelib_stem) .EQS. "" THEN -
2674     sitelib_stem ="/''vms_prefix'/lib/site_perl"
2675 $ IF F$TYPE(sitelibexp) .EQS. "" THEN -
2676     sitelibexp ="/''vms_prefix'/lib/site_perl"
2677 $!
2678 $! determine whether to use malloc wrapping
2679 $ echo ""
2680 $ bool_dflt = "y"
2681 $ IF F$TYPE(usemallocwrap) .nes. ""
2682 $ then
2683 $   if .NOT. usemallocwrap .or. usemallocwrap .eqs. "undef" then bool_dflt = "n"
2684 $ endif
2685 $ rp = "Do you wish to wrap malloc calls to protect against potential overflows? [''bool_dflt'] "
2686 $ GOSUB myread
2687 $ IF ans
2688 $ THEN usemallocwrap = "define"
2689 $ ELSE usemallocwrap = "undef"
2690 $ ENDIF
2691 $!
2692 $! Ask if they want to use perl's memory allocator
2693 $ echo ""
2694 $ echo "Perl has a built-in memory allocator that is tuned for normal"
2695 $ echo "memory usage.  It is oftentimes better than the standard system"
2696 $ echo "memory allocator.  It also has the advantage of providing memory"
2697 $ echo "allocation statistics, if you choose to enable them."
2698 $ bool_dflt = "n"
2699 $ IF F$TYPE(usemymalloc) .nes. ""
2700 $ then
2701 $   if usemymalloc .or. usemymalloc .eqs. "define" then bool_dflt = "y"
2702 $ endif
2703 $ rp = "Do you wish to attempt to use the malloc that comes with ''package'? [''bool_dflt'] "
2704 $ GOSUB myread
2705 $ mymalloc = ans
2706 $ IF mymalloc
2707 $ THEN
2708 $   IF use_debugging_perl
2709 $   THEN
2710 $     echo ""
2711 $     echo "Perl can keep statistics on memory usage if you choose to use"
2712 $     echo "them.  This is useful for debugging, but does have some"
2713 $     echo "performance overhead."
2714 $     bool_dflt = "n"
2715 $     rp = "Do you want the debugging memory allocator? [''bool_dflt'] "
2716 $     gosub myread
2717 $     use_debugmalloc = ans
2718 $   ENDIF
2719 $   ! Check which memory allocator we want
2720 $   echo ""
2721 $   echo "There are currently three different memory allocators: the"
2722 $   echo "default (which is a pretty good general-purpose memory manager),"
2723 $   echo "the TWO_POT allocator (which is optimized to save memory for"
2724 $   echo "larger allocations), and PACK_MALLOC (which is optimized to save"
2725 $   echo "memory for smaller allocations). They're all good, but if your"
2726 $   echo "usage tends towards larger chunks use TWO_POT, otherwise use"
2727 $   echo "PACK_MALLOC."
2728 $   dflt = "DEFAULT"
2729 $   rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2730 $   GOSUB myread
2731 $   if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2732 $   if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2733 $ ENDIF
2734 $!
2735 $ xs_extensions = ""
2736 $ xxx = ""
2737 $ OPEN/READ CONFIG 'manifestfound'
2738 $ext_loop:
2739 $   READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
2740 $   IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
2741        F$EXTRACT(0,5,line) .NES. "dist/".AND. -
2742        F$EXTRACT(0,5,line) .NES. "cpan/" THEN goto ext_loop
2743 $   line = F$EDIT(line,"COMPRESS")
2744 $   line = F$ELEMENT(0," ",line)
2745 $   IF F$EXTRACT(0,4,line) .EQS. "ext/"
2746 $   THEN
2747 $     xxx = F$ELEMENT(1,"/",line)
2748 $     IF F$SEARCH("[-.ext]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2749 $   ENDIF
2750 $   IF F$EXTRACT(0,5,line) .EQS. "dist/"
2751 $   THEN
2752 $     xxx = F$ELEMENT(1,"/",line)
2753 $     IF F$SEARCH("[-.dist]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2754 $   ENDIF
2755 $   IF F$EXTRACT(0,5,line) .EQS. "cpan/"
2756 $   THEN
2757 $     xxx = F$ELEMENT(1,"/",line)
2758 $     IF F$SEARCH("[-.cpan]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2759 $   ENDIF
2760 $   IF xxx .EQS. "DynaLoader" THEN goto ext_loop     ! omit
2761 $!
2762 $! (extspec = xxx) =~ tr!-!/!
2763 $ extspec = ""
2764 $ idx = 0
2765 $ extension_dir_name = xxx
2766 $ replace_dash_with_slash:
2767 $   before = F$ELEMENT(idx, "-", xxx)
2768 $   IF before .EQS. "-" THEN goto end_replace_dash_with_slash
2769 $   IF extspec .NES. "" 
2770 $   THEN
2771 $       extspec = extspec + "/"
2772 $   ENDIF
2773 $   extspec = extspec + before
2774 $   idx = idx + 1
2775 $   goto replace_dash_with_slash
2776 $
2777 $ end_replace_dash_with_slash:
2778 $!
2779 $ IF extspec .EQS. "Scalar/List/Utils" THEN extspec = "List/Util"
2780 $ IF extspec .EQS. "PathTools" THEN extspec = "Cwd"
2781 $!
2782 $ xxx = xs_extensions
2783 $ gosub may_already_have_extension
2784 $ IF $STATUS .EQ. 1
2785 $ THEN
2786 $     xxx = nonxs_ext
2787 $     gosub may_already_have_extension
2788 $ ENDIF
2789 $ IF $STATUS .EQ. 1
2790 $ THEN
2791 $     xxx = nonxs_ext2
2792 $     gosub may_already_have_extension
2793 $ ENDIF
2794 $ IF $STATUS .NE. 1 THEN goto ext_loop
2795 $ goto found_new_extension
2796 $!
2797 $ may_already_have_extension:
2798 $   idx = F$LOCATE(extspec, xxx)
2799 $   extlen = F$LENGTH(xxx) 
2800 $   IF idx .EQ. extlen THEN return 1    ! didn't find it
2801 $!  But "Flirble" may just be part of "Acme-Flirble".  This is not
2802 $!  bullet-proof because we may only be looking at one chunk of the
2803 $!  existing extension list.
2804 $   IF idx .GT. 0 .AND. F$EXTRACT(idx - 1, 1, xxx) .NES. " "
2805 $   THEN
2806 $       xxx = F$EXTRACT(idx + F$LENGTH(extspec) + 1, extlen, xxx)
2807 $       GOTO may_already_have_extension
2808 $   ENDIF
2809 $!  But "Foo" may just be part of "Foo-Bar" so check for equality.
2810 $   xxx = F$EXTRACT(idx, extlen - idx, xxx)
2811 $   IF F$ELEMENT(0, " ", xxx) .EQS. extspec
2812 $   THEN 
2813 $       RETURN 3
2814 $   ELSE 
2815 $       xxx = F$EXTRACT(F$LENGTH(extspec) + 1, extlen, xxx)
2816         GOTO may_already_have_extension
2817 $   ENDIF
2818 $!
2819 $ found_new_extension:
2820 $   IF F$SEARCH("[-.ext.''extension_dir_name']*.xs") .EQS. "" -
2821         .AND. F$SEARCH("[-.dist.''extension_dir_name']*.xs") .EQS. "" -
2822         .AND. F$SEARCH("[-.cpan.''extension_dir_name']*.xs") .EQS. "" -
2823         .AND. extension_dir_name .NES. "VMS-Filespec"
2824 $   THEN
2825 $!  Bit if a hack to get around the 1K buffer on older systems.
2826 $       IF F$LENGTH(nonxs_ext) .GT. 950
2827 $       THEN
2828 $           nonxs_ext2 = nonxs_ext2 + " ''extspec'"
2829 $       ELSE
2830 $           nonxs_ext = nonxs_ext + " ''extspec'"
2831 $       ENDIF
2832 $   ELSE
2833 $       xs_extensions = xs_extensions + " ''extspec'"
2834 $   ENDIF
2835 $   goto ext_loop
2836 $end_ext:
2837 $ close CONFIG
2838 $ DELETE/SYMBOL xxx
2839 $ DELETE/SYMBOL idx
2840 $ DELETE/SYMBOL extspec
2841 $ DELETE/SYMBOL extlen
2842 $ DELETE/SYMBOL extension_dir_name
2843 $ xs_extensions = F$EDIT(xs_extensions,"TRIM,COMPRESS")
2844 $ dflt = xs_extensions
2845 $ dflt = dflt - "ByteLoader"          ! needs to be ported
2846 $ dflt = dflt - "DB_File"             ! needs to be ported
2847 $ dflt = dflt - "GDBM_File"           ! needs porting/special library
2848 $ dflt = dflt - "IPC/SysV"            ! needs to be ported
2849 $ dflt = dflt - "NDBM_File"           ! needs porting/special library
2850 $ dflt = dflt - "ODBM_File"           ! needs porting/special library
2851 $ dflt = dflt - "Sys/Syslog"          ! needs porting/special library "GDBM_File macro LOG_DEBUG"
2852 $ IF .NOT. Has_Dec_C_Sockets
2853 $ THEN
2854 $   dflt = dflt - "Socket"            ! optional on VMS
2855 $ ENDIF
2856 $ dflt = dflt - "Win32API/File" - "Win32"  ! need Dave Cutler's other project
2857 $ dflt = dflt - "Amiga/ARexx" - "Amiga/Exec" ! this is not AmigaOS
2858 $ nonxs_ext = nonxs_ext - "Win32CORE"
2859 $ nonxs_ext2 = nonxs_ext2 - "Win32CORE"
2860 $ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2861 $ nonxs_ext = F$EDIT(nonxs_ext,"TRIM,COMPRESS")
2862 $ nonxs_ext2 = F$EDIT(nonxs_ext2,"TRIM,COMPRESS")
2863 $!
2864 $! Ask for their default list of extensions to build
2865 $ echo ""
2866 $ echo "It is time to specify which modules you want to build into"
2867 $ echo "perl. Most of these are standard and should be chosen, though"
2868 $ echo "you might, for example, want to build GDBM_File instead of"
2869 $ echo "SDBM_File if you have the GDBM library built on your machine."
2870 $ echo ""
2871 $ echo "Which modules do you want to build into perl?"
2872 $ rp = "[''dflt'] "
2873 $ GOSUB myread
2874 $ dynamic_ext = F$EDIT(ans,"TRIM,COMPRESS")
2875 $!
2876 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2877 $ echo ""
2878 $ echo "Checking your ""make"" utilities..."
2879 $! If the 'build' that you use is not here add it and it's test
2880 $! switch to the _END_ of these strings (and increment max_build)
2881 $! (e.g. builders = builders + "/FOOMAKE" 
2882 $!       probers  = probers + " -fooVersionSwitch"
2883 $! ) & please let me know about it.
2884 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2885 $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2886 $ max_build = 7
2887 $!
2888 $ orig_dflt = f$edit(builder,"UPCASE")
2889 $ if orig_dflt .eqs. "" then orig_dflt = "MMK"
2890 $ default_set = ""
2891 $ ok_builders = ""
2892 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2893 $ WRITE CONFIG "dont_make_anything_yet:"
2894 $ WRITE CONFIG F$FAO("!_")
2895 $ CLOSE CONFIG
2896 $ n = 0
2897 $ messages = F$ENVIRONMENT("MESSAGE")
2898 $Build_probe:
2899 $ build = F$ELEMENT(n,"/",builders)
2900 $ probe  = F$ELEMENT(n,"!",probers)
2901 $ echo "Testing whether you have ''build' on your system..."
2902 $!
2903 $! Noted with GNU Make version 3.60  that the $status and $severity
2904 $! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2905 $! $SEVERITY == "4".
2906 $!
2907 $ SET NOON
2908 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2909 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2910 $ 'build' 'probe'
2911 $ IF ($SEVERITY .EQ. 1) ! not adequate?
2912 $ THEN 
2913 $   echo "OK."
2914 $   IF (build .EQS. orig_dflt) 
2915 $   THEN 
2916 $     default_set = "TRUE"
2917 $     dflt = build
2918 $   ENDIF
2919 $   ok_builders = ok_builders + " " + build
2920 $   IF (.NOT. default_set) THEN dflt = build
2921 $ ELSE 
2922 $   echo "Nope."
2923 $ ENDIF
2924 $Reenable_messages_build:
2925 $ SET MESSAGE 'messages'
2926 $ SET ON
2927 $ on control_y then goto clean_up
2928 $ n = n + 1
2929 $ IF (n .LT. max_build) THEN GOTO Build_probe
2930 $!
2931 $ echo ""
2932 $ IF (ok_builders .NES. "") 
2933 $ THEN
2934 $   echo "Here is the list of builders you can apparently use:"
2935 $   echo "(",ok_builders," )"
2936 $   rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
2937 $   GOSUB myread
2938 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2939 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2940 $   IF (ans .EQS. "") 
2941 $   THEN build = dflt
2942 $   ELSE build = ans
2943 $   ENDIF
2944 $ ELSE
2945 $   TYPE SYS$INPUT:
2946 $   DECK
2947
2948 %Config-E-VMS, ERROR:
2949  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2950  utility of some sort and after checking my "builders" list I cannot find
2951  the symbol or command you use on your system to compile programs.
2952
2953 $   EOD
2954 $   READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
2955 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2956 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2957 $   IF (ans .EQS. "") 
2958 $   THEN build = dflt
2959 $     echo "I do not know where ""make"" is, and my life depends on it."
2960 $     echo "Go find a make program or fix your DCL$PATH setting!"
2961 $     echo "ABORTING..."
2962 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
2963 $     STOP
2964 $     EXIT 2 !$STATUS = "%X00000002" (error)
2965 $   ELSE 
2966 $     build = ans
2967 $   ENDIF
2968 $ ENDIF
2969 $!
2970 $ DELETE/NOLOG/NOCONFIRM Makefile.;
2971 $ GOTO Beyond_open
2972 $Open_error:
2973 $ TYPE SYS$INPUT:
2974 $ DECK
2975
2976  There seems to be trouble. I just tried to create a file in
2977 $ EOD
2978 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2979 $ TYPE SYS$INPUT:
2980 $ DECK
2981  but was unsuccessful. I am stopping now. Please check that directories'
2982  PROTECTION bits. I will leave you in the directory where you started
2983  Configure.com
2984 $ EOD
2985 $ echo4 "ABORTING..."
2986 $ GOTO Clean_up
2987 $ STOP
2988 $ EXIT
2989 $!
2990 $Beyond_open:
2991 $! echo " Very well I will proceed with ""''build'"""
2992 $ make = F$EDIT(build,"UPCASE")
2993 $!
2994 $!: locate the preferred pager for this system
2995 $!pagers = "most|more|less|type/page"
2996 $ IF osvers .GES. "V6.1"
2997 $ THEN
2998 $   dflt = "type/page=save=10"
2999 $ ELSE
3000 $   dflt = "type/page"
3001 $ ENDIF
3002 $! assume that the presence of a most symbol indicates the presence
3003 $! of the pager.
3004 $ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
3005 $ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
3006 $ rp="What pager is used on your system? [''dflt'] "
3007 $ GOSUB myread
3008 $ pager = ans
3009 $!
3010 $ bool_dflt = "y"
3011 $ IF F$TYPE(default_inc_excludes_dot) .NES. ""
3012 $ THEN
3013 $   IF .not. default_inc_excludes_dot .or. default_inc_excludes_dot .eqs. "undef" THEN bool_dflt = "n"
3014 $ ENDIF
3015 $ echo ""
3016 $ echo "Historically Perl has provided a final fallback of the current working"
3017 $ echo "directory '.' when searching for a library. This, however, can lead to"
3018 $ echo "problems when a Perl program which loads optional modules is called from"
3019 $ echo "a shared directory. This can lead to executing unexpected code."
3020 $ echo ""
3021 $ rp = "Exclude '.' from @INC by default? [''bool_dflt'] "
3022 $ GOSUB myread
3023 $ default_inc_excludes_dot = ans
3024 $ IF default_inc_excludes_dot
3025 $ THEN
3026 $   default_inc_excludes_dot = "define"
3027 $ ELSE
3028 $   default_inc_excludes_dot = "undef"
3029 $ ENDIF
3030 $!
3031 $! update makefile here
3032 $! echo4 "Updating makefile..."
3033 $!
3034 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
3035 $ THEN 
3036 $   makefile    = ""               !wrt MANIFEST dir
3037 $   UUmakefile  = "[-]DESCRIP.MMS" !wrt CWD dir
3038 $   DEFmakefile = "DESCRIP.MMS"    !wrt DEF dir (?)
3039 $   Makefile_SH = "descrip_mms.template"
3040 $ ELSE
3041 $   makefile    = " -f Makefile."  !wrt MANIFEST dir
3042 $   UUmakefile  = "[-]Makefile."   !wrt CWD dir
3043 $   DEFmakefile = "Makefile."      !wrt DEF dir (?)
3044 $   Makefile_SH = "Makefile.in"
3045 $ ENDIF
3046 $!
3047 $ IF macros .NES. "" 
3048 $ THEN
3049 $   tmp = F$LENGTH(macros)
3050 $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
3051 $   macros = "/macro=(" + macros  + ")"
3052 $ ENDIF
3053 $! Build up the extra C flags
3054 $!
3055 $ IF use_ieee_math
3056 $ THEN
3057 $   extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm"
3058 $ ELSE
3059 $   IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
3060 $   THEN
3061 $     extra_flags = "''extra_flags'" + "/float=g_float"
3062 $   ENDIF
3063 $ ENDIF
3064 $ names_flags = ""
3065 $ IF be_case_sensitive
3066 $ THEN
3067 $   names_flags = "AS_IS"
3068 $ ENDIF
3069 $ IF shorten_long_symbols
3070 $ THEN
3071 $   IF be_case_sensitive
3072 $   THEN
3073 $     names_flags = "''names_flags',SHORTENED"
3074 $   ELSE
3075 $     names_flags = "SHORTENED"
3076 $   ENDIF
3077 $ ENDIF
3078 $ IF F$LENGTH(names_flags) .ne. 0
3079 $ THEN
3080 $   extra_flags = "''extra_flags'" + "/NAMES=(''names_flags')"
3081 $ ENDIF
3082 $ DELETE/SYMBOLS names_flags
3083 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
3084 $!
3085 $ min_pgflquota = "100000"
3086 $ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
3087 $ IF pgflquota .LES. min_pgflquota
3088 $ THEN
3089 $   echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
3090 $   READ SYS$COMMAND/PROMPT="Continue? [n] " ans
3091 $   IF ans
3092 $   THEN
3093 $     echo4 "Continuing..."
3094 $   ELSE
3095 $     echo4 "ABORTING..."
3096 $     GOTO Clean_up
3097 $   ENDIF
3098 $ ENDIF
3099 $!
3100 $ echo ""
3101 $ echo4 "Checking the C run-time library."
3102 $!
3103 $! Former SUBCONFIGURE.COM
3104 $!
3105 $!  - build a config.sh for VMS Perl.
3106 $!  - use built config.sh to take config_h.SH -> config.h
3107 $!  - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
3108 $!              vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
3109 $!              vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
3110 $!
3111 $! Note for folks from other platforms changing things in here:
3112 $!
3113 $!   Fancy changes (based on compiler capabilities or VMS version or
3114 $!   whatever) are tricky, so go ahead and punt on those.
3115 $!
3116 $!   Simple changes, though (say, always setting something to 1, or undef,
3117 $!   or something like that) are straightforward.  Adding a new constant 
3118 $!   item for the ultimately created config.sh requires at least one 
3119 $!   (possibly more) line(s) to this file.
3120 $!
3121 $!   Add a line in the format:
3122 $!
3123 $!     $ WC "foo='undef'"
3124 $!
3125 $!   somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
3126 $!   and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
3127 $!   is sorted ASCII and corresponds to the output of config.sh in the 
3128 $!   Bourne shell version of Configure).
3129 $!   Be very careful with quoting, as it can be tricky.
3130 $!   For example if instead of a constant string like 'undef' or 'define' 
3131 $!   you wanted to add something to VMS's config.sh that looks like:
3132 $!
3133 $!     blank_string=''
3134 $!
3135 $!   then add a line that looks like this before the 
3136 $!   '##END WRITE NEW CONSTANTS HERE##' tagged line:
3137 $!
3138 $!     $ WC "blank_string='" + "'"
3139 $!
3140 $!   (+ is the string concatenator and "''var'" has the effect 
3141 $!    of "${var}" in perl or sh, but "'const'" is not interpolated).
3142 $!
3143 $!   Note that unitialized variables, such as a line like:
3144 $!
3145 $!     $ WC "new_var='" + new_var + "'"
3146 $!
3147 $!   should be avoided unless new_var has a value assigned prior 
3148 $!   to that line (think of perl's -w warnings).
3149 $!
3150 $!     %DCL-W-UNDSYM, undefined symbol - check validity and spelling
3151 $!     \NEW_VAR\
3152 $!
3153 $!
3154 $ vms_ver = F$EXTRACT(1,3, osvers)
3155 $ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
3156 $ MCC = f$edit(mcc, "UPCASE")
3157 $ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
3158 $ IF ccname .EQS. "DEC"
3159 $ THEN
3160 $   Checkcc := "''Mcc'/prefix=all"
3161 $ ELSE
3162 $   IF ccname .EQS. "CXX"
3163 $   THEN
3164 $     Checkcc := cxx
3165 $   ELSE
3166 $     Checkcc := "''Mcc'"
3167 $   ENDIF
3168 $ ENDIF
3169 $ ccflags = ccflags + extra_flags
3170 $ IF be_case_sensitive
3171 $ THEN
3172 $   d_vms_be_case_sensitive = "define"
3173 $ ELSE
3174 $   d_vms_be_case_sensitive = "undef"
3175 $ ENDIF
3176 $ IF shorten_long_symbols
3177 $ THEN
3178 $   d_vms_shorten_long_symbols = "define"
3179 $ ELSE
3180 $   d_vms_shorten_long_symbols = "undef"
3181 $ ENDIF
3182 $! Some constant defaults.
3183 $ hwname = f$getsyi("HW_NAME")
3184 $ myname = myhostname
3185 $ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
3186 $!
3187 $ ccdlflags=""
3188 $ cccdlflags=""
3189 $!
3190 $! FIXME -- This section does not really handle all the different permutations 
3191 $! of 64-bitness, and it does not provide for the /POINTER_SIZE=64 compiler
3192 $! option that would be necessary to support the "explicit 64-bit interfaces"
3193 $! promised by -Dusemorebits.
3194 $!
3195 $ usemorebits = "undef"
3196 $ IF use64bitint .OR. use64bitint .EQS. "define"
3197 $ THEN
3198 $   use64bitint = "define"
3199 $   ivdformat="""Ld"""
3200 $   uvuformat="""Lu"""
3201 $   uvoformat="""Lo"""
3202 $   uvxformat="""Lx"""
3203 $   uvXUformat="""LX"""
3204 $ ELSE
3205 $   use64bitint = "undef"
3206 $   ivdformat="""ld"""
3207 $   uvuformat="""lu"""
3208 $   uvoformat="""lo"""
3209 $   uvxformat="""lx"""
3210 $   uvXUformat="""lX"""
3211 $ ENDIF
3212 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
3213 $ THEN
3214 $   uselongdouble = "define"
3215 $   alignbytes="16"
3216 $   nveformat="""Le"""
3217 $   nvEUformat="""LE"""
3218 $   nvfformat="""Lf"""
3219 $   nvFUformat="""LF"""
3220 $   nvgformat="""Lg"""
3221 $   nvGUformat="""LG"""
3222 $ ELSE
3223 $   uselongdouble = "undef"
3224 $   nveformat="""e"""
3225 $   nvEUformat="""E"""
3226 $   nvfformat="""f"""
3227 $   nvFUformat="""F"""
3228 $   nvgformat="""g"""
3229 $   nvGUformat="""G"""
3230 $ ENDIF
3231 $ IF use64bitall .OR. use64bitall .EQS. "define"
3232 $ THEN
3233 $   use64bitall = "define"
3234 $ ELSE
3235 $   use64bitall = "undef"
3236 $ ENDIF
3237 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
3238 $ THEN
3239 $   uselargefiles = "define"
3240 $ ELSE
3241 $   uselargefiles = "undef"
3242 $ ENDIF
3243 $!
3244 $ usemymalloc = "undef"
3245 $ if mymalloc then usemymalloc = "define"
3246 $!
3247 $ perl_cc=Mcc
3248 $!
3249 $ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP")
3250 $ THEN
3251 $   obj_ext=".abj"
3252 $   so="axe"
3253 $   dlext="axe"
3254 $   exe_ext=".axe"
3255 $   lib_ext=".alb"
3256 $ ELSE
3257 $   IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_IA64")
3258 $   THEN
3259 $     obj_ext=".ibj"
3260 $     so="ixe"
3261 $     dlext="ixe"
3262 $     exe_ext=".ixe"
3263 $     lib_ext=".ilb"
3264 $   ELSE
3265 $     obj_ext=".obj"
3266 $     so="exe"
3267 $     dlext="exe"
3268 $     exe_ext=".exe"
3269 $     lib_ext=".olb"
3270 $   ENDIF
3271 $ ENDIF
3272 $ dlobj="dl_vms''obj_ext'"
3273 $!
3274 $ cppstdin="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3275 $ cppminus=" "
3276 $ cpprun="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3277 $ cpplast=" "
3278 $!
3279 $ timetype="time_t"
3280 $ signal_t="void"
3281 $ stdchar="char"
3282 $!
3283 $ IF mymalloc
3284 $ THEN d_mymalloc="define"
3285 $ ELSE d_mymalloc="undef"
3286 $ ENDIF
3287 $!
3288 $ usedl="define"
3289 $ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
3290 $ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
3291 $!
3292 $ libs=" "
3293 $ libc="(DECCRTL)"
3294 $!
3295 $! perllibs should be libs with all non-core libs (such as gdbm) removed.
3296 $!
3297 $ perllibs=libs
3298 $!
3299 $!
3300 $ d_PRId64 = "define"
3301 $ d_PRIi64 = "define"
3302 $ d_PRIu64 = "define"
3303 $ d_PRIo64 = "define"
3304 $ d_PRIx64 = "define"
3305 $ d_PRIXU64 = "define"
3306 $ sPRId64 = """Ld"""
3307 $ sPRIXU64 = """LX"""
3308 $ sPRIi64 = """Li"""
3309 $ sPRIo64 = """Lo"""
3310 $ sPRIu64 = """Lu"""
3311 $ sPRIx64 = """Lx"""
3312 $ d_quad = "define"
3313 $ quadtype = "long long"
3314 $ uquadtype = "unsigned long long"
3315 $ quadkind  = "3"
3316 $!
3317 $ d_frexpl = "define"
3318 $ d_ldexpl = "define"
3319 $ d_modfl = "define"
3320 $ d_modflproto = "define"
3321 $!
3322 $ d_double_has_inf = "undef"
3323 $ d_double_has_nan = "undef"
3324 $ d_double_has_negative_zero = "undef"
3325 $ d_double_has_subnormals = "undef"
3326 $ d_double_style_cray = "undef"
3327 $ d_double_style_ibm = "undef"
3328 $ d_double_style_ieee = "undef"
3329 $ d_double_style_vax = "undef"
3330 $ d_long_double_style_ieee = "undef"
3331 $ d_long_double_style_ieee_extended = "undef"
3332 $ d_long_double_style_ieee_std = "undef"
3333 $ d_long_double_style_vax = "undef"
3334 $ IF useieee .OR. useieee .EQS. "define"
3335 $ THEN
3336 $   d_double_has_inf = "define"
3337 $   d_double_has_nan = "define"
3338 $   d_double_has_negative_zero = "define"
3339 $   d_double_has_subnormals = "define"
3340 $   d_double_style_ieee = "define"
3341 $   IF uselongdouble .OR. uselongdouble .EQS. "define"
3342 $   THEN
3343 $       d_long_double_style_ieee = "define"
3344 $! TODO: will the Intel port have ieee_extended for long doubles?
3345 $       d_long_double_style_ieee_std = "define"
3346 $   ENDIF
3347 $   d_acosh = "define"
3348 $   d_asinh = "define"
3349 $   d_atanh = "define"
3350 $   d_cbrt = "define"
3351 $   d_copysign = "define"
3352 $   d_erf = "define"
3353 $   d_erfc = "define"
3354 $   d_exp2 = "define"
3355 $   d_expm1 = "define"
3356 $   d_fdim = "define"
3357 $   d_fma = "define"
3358 $   d_fmax = "define"
3359 $   d_fmin = "define"
3360 $   d_fp_classify = "define"
3361 $   d_hypot = "define"
3362 $   d_ilogb = "define"
3363 $   d_isnan = "define"
3364 $   d_isnormal = "define"
3365 $   d_j0 = "define"
3366 $   d_lgamma = "define"
3367 $   d_log1p = "define"
3368 $   d_log2 = "define"
3369 $   d_logb = "define"
3370 $   d_lrint = "define"
3371 $   d_lrintl = "define"
3372 $   d_lround = "define"
3373 $   d_lroundl = "define"
3374 $   d_nextafter = "define"
3375 $   d_nexttoward = "define"
3376 $   d_remainder = "define"
3377 $   d_remquo = "define"
3378 $   d_rint = "define"
3379 $   d_tgamma = "define"
3380 $   d_trunc = "define"
3381 $   d_truncl = "define"
3382 $ ELSE
3383 $   d_double_style_vax = "define"
3384 $   IF uselongdouble .OR. uselongdouble .EQS. "define"
3385 $   THEN
3386 $       d_long_double_style_vax = "undef" ! VAX format H unlikely
3387 $   ENDIF
3388 $   d_acosh = "undef"
3389 $   d_acosh = "undef"
3390 $   d_asinh = "undef"
3391 $   d_atanh = "undef"
3392 $   d_cbrt = "undef"
3393 $   d_copysign = "undef"
3394 $   d_erf = "undef"
3395 $   d_erfc = "undef"
3396 $   d_exp2 = "undef"
3397 $   d_expm1 = "undef"
3398 $   d_fdim = "undef"
3399 $   d_fma = "undef"
3400 $   d_fmax = "undef"
3401 $   d_fmin = "undef"
3402 $   d_fp_classify = "undef"
3403 $   d_hypot = "undef"
3404 $   d_ilogb = "undef"
3405 $   d_isnan = "undef"
3406 $   d_isnormal = "undef"
3407 $   d_j0 = "undef"
3408 $   d_lgamma = "undef"
3409 $   d_log1p = "undef"
3410 $   d_log2 = "undef"
3411 $   d_logb = "undef"
3412 $   d_lrint = "undef"
3413 $   d_lrintl = "undef"
3414 $   d_lround = "undef"
3415 $   d_lroundl = "undef"
3416 $   d_nextafter = "undef"
3417 $   d_nexttoward = "undef"
3418 $   d_remainder = "undef"
3419 $   d_remquo = "undef"
3420 $   d_rint = "undef"
3421 $   d_tgamma = "undef"
3422 $   d_trunc = "undef"
3423 $   d_truncl = "undef"
3424 $ ENDIF
3425 $!
3426 $! Now some that we build up
3427 $!
3428 $ d_old_pthread_create_joinable = "undef"
3429 $ old_pthread_create_joinable = " "
3430 $ IF use_threads
3431 $ THEN
3432 $    useithreads = "define"
3433 $ ELSE
3434 $   useithreads = "undef"
3435 $ ENDIF
3436 $!
3437 $! Some that we need to invoke the compiler for
3438 $!
3439 $!
3440 $! handy construction aliases/symbols
3441 $!
3442 $ OS := "open/write CONFIG []try.c"
3443 $ WS := "write CONFIG"
3444 $ CS := "close CONFIG"
3445 $ DS := "delete/nolog/noconfirm []try.*;*"
3446 $ Needs_Opt := N
3447 $ good_compile = %X10B90001
3448 $ IF ccname .EQS. "GCC"
3449 $ THEN
3450 $   open/write OPTCHAN []try.opt
3451 $   write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3452 $   write OPTCHAN "Sys$Share:VAXCRTL/Share"
3453 $   Close OPTCHAN
3454 $   Needs_Opt := Y
3455 $   good_compile = %X10000001
3456 $ ENDIF
3457 $ IF ccname .EQS. "CXX"
3458 $ THEN
3459 $   good_compile = %X15F60001
3460 $ ENDIF
3461 $ good_link = %X10000001
3462 $ tmp = "" ! null string default
3463 $!
3464 $ GOTO beyond_compile_ok
3465 $!
3466 $! Check for type sizes 
3467 $!
3468 $type_size_check: 
3469 $!
3470 $ OS
3471 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3472 $ WS "#include <stdlib.h>"
3473 $ WS "#endif"
3474 $ WS "#include <stdio.h>"
3475 $ WS "int main()"
3476 $ WS "{"
3477 $ WS "printf(""%d\n"", sizeof(''tmp'));"
3478 $ WS "exit(0);"
3479 $ WS "}"
3480 $ CS
3481 $ GOSUB compile
3482 $ RETURN
3483 $!
3484 $!: locate header file
3485 $findhdr:
3486 $!
3487 $ OS
3488 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3489 $ WS "#include <stdlib.h>"
3490 $ WS "#endif"
3491 $ WS "#include <stdio.h>"
3492 $ WS "#include <''tmp'>"
3493 $ WS "int main()"
3494 $ WS "{"
3495 $ WS "printf(""define\n"");"
3496 $ WS "exit(0);"
3497 $ WS "}"
3498 $ CS
3499 $ GOSUB link_ok
3500 $ RETURN
3501 $!
3502 $!: define an alternate in-header-list? function
3503 $inhdr:
3504 $!
3505 $ GOSUB findhdr
3506 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3507 $ THEN
3508 $   echo4 "<''tmp'> found."
3509 $   tmp = "define"
3510 $ ELSE
3511 $   echo4 "<''tmp'> NOT found."
3512 $   tmp = "undef"
3513 $ ENDIF
3514 $ RETURN
3515 $!
3516 $!: define an is-in-libc? function
3517 $inlibc: 
3518 $ GOSUB link_ok
3519 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3520 $ THEN
3521 $   echo4 "''tmp'() found."
3522 $   tmp = "define"
3523 $ ELSE
3524 $   echo4 "''tmp'() NOT found."
3525 $   tmp = "undef"
3526 $ ENDIF
3527 $ RETURN
3528 $!
3529 $!: define a shorthand compile call
3530 $compile:
3531 $ GOSUB link_ok
3532 $just_mcr_it:
3533 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3534 $ THEN
3535 $   OPEN/WRITE CONFIG []try.out
3536 $   DEFINE/USER_MODE SYS$ERROR CONFIG
3537 $   DEFINE/USER_MODE  SYS$OUTPUT CONFIG
3538 $   MCR []try.exe
3539 $   CLOSE CONFIG
3540 $   OPEN/READ CONFIG []try.out
3541 $   READ CONFIG tmp
3542 $   CLOSE CONFIG
3543 $   DELETE/NOLOG/NOCONFIRM []try.out;
3544 $   DELETE/NOLOG/NOCONFIRM []try.exe;
3545 $ ELSE
3546 $   tmp = "" ! null string default
3547 $ ENDIF
3548 $ RETURN
3549 $!
3550 $link_ok:
3551 $ GOSUB compile_ok
3552 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3553 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3554 $ SET NOON
3555 $ IF Needs_Opt
3556 $ THEN
3557 $   'ld' try.obj,try.opt/opt
3558 $   link_status = $status
3559 $ ELSE
3560 $   'ld' try.obj
3561 $   link_status = $status
3562 $ ENDIF
3563 $ SET ON
3564 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3565 $ RETURN
3566 $!
3567 $!: define a shorthand compile call for compilations that should be ok.
3568 $compile_ok:
3569 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3570 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3571 $ SET NOON
3572 $ 'Checkcc' try.c
3573 $ compile_status = $status
3574 $ SET ON
3575 $ DELETE/NOLOG/NOCONFIRM try.c;
3576 $ RETURN
3577 $!
3578 $beyond_compile_ok:
3579 $!
3580 $! Check for __STDC__
3581 $!
3582 $ OS
3583 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3584 $ WS "#include <stdlib.h>"
3585 $ WS "#endif"
3586 $ WS "#include <stdio.h>"
3587 $ WS "int main()"
3588 $ WS "{"
3589 $ WS "#ifdef __STDC__"
3590 $ WS "printf(""42\n"");"
3591 $ WS "#elif defined (__STD_ANSI)" ! for CXX
3592 $ WS "printf(""42\n"");"
3593 $ WS "#else"
3594 $ WS "printf(""1\n"");"
3595 $ WS "#endif"
3596 $ WS "exit(0);"
3597 $ WS "}"
3598 $ CS
3599 $ GOSUB compile
3600 $ cpp_stuff=tmp
3601 $ IF F$INTEGER(tmp) .eq. 42
3602 $ THEN
3603 $   echo4 "Oh!  Smells like ANSI's been here."
3604 $   echo "We can catify or stringify, separately or together!"
3605 $ ENDIF
3606 $!
3607 $! Check for double size
3608 $!
3609 $ echo4 "Checking to see how big your double precision numbers are..."
3610 $ tmp="double"
3611 $ GOSUB type_size_check
3612 $ doublesize = tmp
3613 $ echo "Your double is ''doublesize' bytes long."
3614 $!
3615 $! Check for long double size
3616 $!
3617 $ OS
3618 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3619 $ WS "#pragma message disable ALL"  ! VAX compilers may have distracting informationals
3620 $ WS "#include <stdlib.h>"
3621 $ WS "#endif"
3622 $ WS "#include <stdio.h>"
3623 $ WS "int main()"
3624 $ WS "{"
3625 $ WS "printf(""%d\n"", sizeof(long double));"
3626 $ WS "exit(0);"
3627 $ WS "}"
3628 $ CS
3629 $ echo4 "Checking to see if you have long double..."
3630 $ GOSUB link_ok
3631 $ IF link_status .NE. good_link
3632 $ THEN
3633 $   longdblsize="0"
3634 $   longdblkind="0"
3635 $   longdblinfbytes="undef"
3636 $   longdblnanbytes="undef"
3637 $   longdblmantbits="undef"
3638 $   d_longdbl="undef"
3639 $   echo "You do not have long double."
3640 $ ELSE
3641 $   echo "You have long double."
3642 $   echo4 "Checking to see how big your long doubles are..."
3643 $   GOSUB just_mcr_it
3644 $   longdblsize = tmp
3645 $   longdblkind = "1"
3646 $   longdblinfbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f"
3647 $   longdblnanbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff"
3648 $   longdblmantbits="112"
3649 $   d_longdbl = "define"
3650 $   echo "Your long doubles are ''longdblsize' bytes long."
3651 $ ENDIF
3652 $!
3653 $ IF d_longdbl .OR. d_longdbl .EQS. "define"
3654 $ THEN
3655 $   d_PRIEUldbl = "define"
3656 $   d_PRIFUldbl = "define"
3657 $   d_PRIGUldbl = "define"
3658 $   d_PRIeldbl = "define"
3659 $   d_PRIfldbl = "define"
3660 $   d_PRIgldbl = "define"
3661 $   sPRIEUldbl = """LE"""
3662 $   sPRIFUldbl = """LF"""
3663 $   sPRIGUldbl = """LG"""
3664 $   sPRIeldbl = """Le"""
3665 $   sPRIfldbl = """Lf"""
3666 $   sPRIgldbl = """Lg"""
3667 $ ELSE
3668 $   d_PRIEUldbl = "undef"
3669 $   d_PRIFUldbl = "undef"
3670 $   d_PRIGUldbl = "undef"
3671 $   d_PRIeldbl = "undef"
3672 $   d_PRIfldbl = "undef"
3673 $   d_PRIgldbl = "undef"
3674 $   sPRIEUldbl = ""
3675 $   sPRIFUldbl = ""
3676 $   sPRIGUldbl = ""
3677 $   sPRIeldbl = ""
3678 $   sPRIfldbl = ""
3679 $   sPRIgldbl = ""
3680 $ ENDIF
3681 $ d_SCNfldbl = d_PRIfldbl
3682 $ sSCNfldbl = sPRIfldbl ! expect consistency
3683 $!
3684 $!: check for long long
3685 $ OS
3686 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3687 $ WS "#include <stdlib.h>"
3688 $ WS "#endif"
3689 $ WS "#include <stdio.h>"
3690 $ WS "int main()"
3691 $ WS "{"
3692 $ WS "printf(""%d\n"", sizeof(long long));"
3693 $ WS "exit(0);"
3694 $ WS "}"
3695 $ CS
3696 $ echo4 "Checking to see if you have long long..."
3697 $ GOSUB link_ok
3698 $ IF link_status .NE. good_link
3699 $ THEN
3700 $   longlongsize="0"
3701 $   d_longlong="undef"
3702 $   echo "You do not have long long."
3703 $ ELSE
3704 $   echo "You have long long."
3705 $   echo4 "Checking to see how big your long longs are..."
3706 $   GOSUB just_mcr_it
3707 $   longlongsize = tmp
3708 $   d_longlong = "define"
3709 $   echo "Your long longs are ''longlongsize' bytes long."
3710 $ ENDIF
3711 $!
3712 $! Check the prototype for getgid
3713 $!
3714 $ echo "Looking for the type for group ids returned by getgid()."
3715 $ OS
3716 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3717 $ WS "#include <stdlib.h>"
3718 $ WS "#endif"
3719 $ WS "#include <stdio.h>"
3720 $ WS "#include <types.h>"
3721 $ WS "int main()"
3722 $ WS "{"
3723 $ WS "gid_t foo;"
3724 $ WS "exit(0);"
3725 $ WS "}"
3726 $ CS
3727 $ GOSUB compile_ok
3728 $ IF compile_status .NE. good_compile
3729 $ THEN
3730 $!   Okay, gid_t failed. Must be unsigned int
3731 $   gidtype = "unsigned int"
3732 $   echo4 "assuming ""''gidtype'""."
3733 $ ELSE
3734 $   gidtype = "gid_t"
3735 $   echo4 "gid_t found."
3736 $ ENDIF
3737 $!
3738 $! Check to see if we've got dev_t
3739 $!
3740 $ echo "Looking for the type for dev."
3741 $ OS
3742 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3743 $ WS "#include <stdlib.h>"
3744 $ WS "#endif"
3745 $ WS "#include <stdio.h>"
3746 $ WS "#include <types.h>"
3747 $ WS "int main()"
3748 $ WS "{"
3749 $ WS "dev_t foo;"
3750 $ WS "exit(0);"
3751 $ WS "}"
3752 $ CS
3753 $ GOSUB compile_ok
3754 $ IF compile_status .NE. good_compile
3755 $ THEN
3756 $!   Okay, dev_t failed. Must be unsigned int
3757 $   devtype = "unsigned int"
3758 $   echo4 "assuming ""''devtype'""."
3759 $ ELSE
3760 $   devtype = "dev_t"
3761 $   echo4 "dev_t found."
3762 $ ENDIF
3763 $!
3764 $! Check to see if we've got unistd.h (which we ought to, but you never know)
3765 $!
3766 $ i_netdb = "undef"
3767 $ tmp = "unistd.h"
3768 $ GOSUB inhdr
3769 $ i_unistd = tmp
3770 $!
3771 $! Check to see if we've got utime.h (which we should use if we have)
3772 $!
3773 $ i_netdb = "undef"
3774 $ tmp = "utime.h"
3775 $ GOSUB inhdr
3776 $ i_utime = tmp
3777 $!
3778 $! do we have getppid()?
3779 $!
3780 $ IF i_unistd .EQS. "define"
3781 $ THEN
3782 $   OS
3783 $   WS "#include <stdio.h>"
3784 $   WS "#include <unistd.h>"
3785 $   WS "int main() {"
3786 $   WS "printf(""%d\n"",getppid());"
3787 $   WS "return(0);"
3788 $   WS "}"
3789 $   CS
3790 $   tmp = "getppid"
3791 $   GOSUB inlibc
3792 $   d_getppid = tmp
3793 $ ELSE
3794 $   d_getppid = "undef"
3795 $ ENDIF
3796 $!
3797 $!: see if this is a libutil.h system
3798 $!
3799 $ tmp = "libutil.h"
3800 $ GOSUB inhdr
3801 $ i_libutil = tmp
3802 $!
3803 $! Check to see if we've got shadow.h (probably not, but...)
3804 $!
3805 $ tmp = "shadow.h"
3806 $ GOSUB inhdr
3807 $ i_shadow = tmp
3808 $!
3809 $! Check to see if we've got socks.h (probably not, but...)
3810 $!
3811 $ tmp = "socks.h"
3812 $ GOSUB inhdr
3813 $ i_socks = tmp
3814 $!
3815 $! Check the prototype for select
3816 $!
3817 $ IF Has_Dec_C_Sockets
3818 $ THEN
3819 $   OS
3820 $   WS "#if defined(__DECC) || defined(__DECCXX)"
3821 $   WS "#include <stdlib.h>"
3822 $   WS "#endif"
3823 $   WS "#include <stdio.h>"
3824 $   WS "#include <types.h>"
3825 $   IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3826 $   WS "#include <time.h>"
3827 $   WS "#include <socket.h>"
3828 $   WS "int main()"
3829 $   WS "{"
3830 $   WS "fd_set *foo;"
3831 $   WS "int bar;"
3832 $   WS "foo = NULL;"
3833 $   WS "bar = select(2, foo, foo, foo, NULL);"
3834 $   WS "exit(0);"
3835 $   WS "}"
3836 $   CS
3837 $   GOSUB compile_ok
3838 $   IF compile_status .NE. good_compile
3839 $   THEN
3840 $!   Okay, select failed.  Must be an int *
3841 $     selecttype = "int *"
3842 $     echo4 "select() NOT found."
3843 $   ELSE
3844 $     selecttype="fd_set *"
3845 $     echo4 "select() found."
3846 $   ENDIF
3847 $ ELSE
3848 $   ! No sockets, so stick in an int * : no select, so pick a harmless default
3849 $   selecttype = "int *"
3850 $ ENDIF
3851 $!
3852 $! Check to see if fd_set exists
3853 $!
3854 $ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3855 $ OS
3856 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3857 $ WS "#include <stdlib.h>"
3858 $ WS "#endif"
3859 $ WS "#include <stdio.h>"
3860 $ WS "#include <types.h>"
3861 $ IF Has_Dec_C_Sockets
3862 $ THEN
3863 $   WS "#include <time.h>"
3864 $   WS "#include <socket.h>"
3865 $ ENDIF
3866 $ WS "int main()"
3867 $ WS "{"
3868 $ WS "fd_set *foo;"
3869 $ WS "int bar;"
3870 $ WS "exit(0);"
3871 $ WS "}"
3872 $ CS
3873 $ GOSUB compile_ok
3874 $ IF compile_status .ne. good_compile
3875 $ THEN
3876 $!  Okay, fd_set failed. Must not exist
3877 $   d_fd_set = "undef"
3878 $   echo4 "Hmm, your compiler has some difficulty with fd_set."
3879 $ ELSE
3880 $   d_fd_set="define"
3881 $   echo4 "Well, your system knows about the normal fd_set typedef..."
3882 $ ENDIF
3883 $!
3884 $! Check for stdint.h
3885 $!
3886 $ tmp = "stdint.h"
3887 $ GOSUB inhdr
3888 $ i_stdint = tmp
3889 $!
3890 $! Check for inttypes.h
3891 $!
3892 $ tmp = "inttypes.h"
3893 $ GOSUB inhdr
3894 $ i_inttypes = tmp
3895 $!
3896 $! Check to see if off64_t exists
3897 $!
3898 $ echo4 "Checking to see if you have off64_t..."
3899 $ OS
3900 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3901 $ WS "#include <stdlib.h>"
3902 $ WS "#endif"
3903 $ WS "#include <stdio.h>"
3904 $ WS "#include <types.h>"
3905 $ WS "#''i_inttypes' IIH"
3906 $ WS "#ifdef IIH"
3907 $ WS "#include <inttypes.h>"
3908 $ WS "#endif"
3909 $ WS "int main()"
3910 $ WS "{"
3911 $ WS "off64_t bar;"
3912 $ WS "exit(0);"
3913 $ WS "}"
3914 $ CS
3915 $ GOSUB compile_ok
3916 $ IF compile_status .EQ. good_compile
3917 $ THEN
3918 $   d_off64_t="define"
3919 $   echo "You have off64_t."
3920 $ ELSE
3921 $   d_off64_t = "undef"
3922 $   echo "You do not have off64_t."
3923 $ ENDIF
3924 $!
3925 $! Check to see if fpclassify exists
3926 $!
3927 $ OS
3928 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3929 $ WS "#include <stdlib.h>"
3930 $ WS "#endif"
3931 $ WS "#include <math.h>"
3932 $ WS "int main()"
3933 $ WS "{"
3934 $ WS "if (fpclassify(0.0) == FP_ZERO) exit(0);"
3935 $ WS "exit(1);"
3936 $ WS "}"
3937 $ CS
3938 $ tmp = "fpclassify"
3939 $ GOSUB inlibc
3940 $ d_fpclassify = tmp
3941 $!
3942 $! Check to see if fpos64_t exists
3943 $!
3944 $ echo4 "Checking to see if you have fpos64_t..."
3945 $ OS
3946 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3947 $ WS "#include <stdlib.h>"
3948 $ WS "#endif"
3949 $ WS "#include <stdio.h>"
3950 $ WS "#include <types.h>"
3951 $ WS "#''i_inttypes' IIH"
3952 $ WS "#ifdef IIH"
3953 $ WS "#include <inttypes.h>"
3954 $ WS "#endif"
3955 $ WS "int main()"
3956 $ WS "{"
3957 $ WS "fpos64_t bar;"
3958 $ WS "exit(0);"
3959 $ WS "}"
3960 $ CS
3961 $ GOSUB compile_ok
3962 $ IF compile_status .EQ. good_compile
3963 $ THEN
3964 $   d_fpos64_t="define"
3965 $   echo "You have fpos64_t."
3966 $ ELSE
3967 $   d_fpos64_t = "undef"
3968 $   echo "You do not have fpos64_t."
3969 $ ENDIF
3970 $!
3971 $! Check to see if int64_t exists
3972 $!
3973 $ echo4 "Checking to see if you have int64_t..."
3974 $ OS
3975 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3976 $ WS "#include <stdlib.h>"
3977 $ WS "#endif"
3978 $ WS "#include <stdio.h>"
3979 $ WS "#include <types.h>"
3980 $ WS "#''i_inttypes' IIH"
3981 $ WS "#ifdef IIH"
3982 $ WS "#include <inttypes.h>"
3983 $ WS "#endif"
3984 $ WS "int main()"
3985 $ WS "{"
3986 $ WS "int64_t bar;"
3987 $ WS "exit(0);"
3988 $ WS "}"
3989 $ CS
3990 $ GOSUB compile_ok
3991 $ IF compile_status .EQ. good_compile
3992 $ THEN
3993 $   d_int64_t="define"
3994 $   echo "You have int64_t."
3995 $ ELSE
3996 $   d_int64_t = "undef"
3997 $   echo "You do not have int64_t."
3998 $ ENDIF
3999 $!
4000 $! Check to see if fseeko exists
4001 $!
4002 $ OS
4003 $ WS "#include <stdio.h>"
4004 $ WS "int main()"
4005 $ WS "{"
4006 $ WS "FILE *f=NULL;"
4007 $ WS "fseeko(f,(off_t)0,SEEK_SET);"
4008 $ WS "return(0);"
4009 $ WS "}"
4010 $ CS
4011 $ tmp = "fseeko"
4012 $ GOSUB inlibc
4013 $ d_fseeko = tmp
4014 $!
4015 $! Check to see if ftello exists
4016 $!
4017 $ OS
4018 $ WS "#include <stdio.h>"
4019 $ WS "int main()"
4020 $ WS "{"
4021 $ WS "FILE *f=NULL; off_t o=0;"
4022 $ WS "o=ftello(f);"
4023 $ WS "return(0);"
4024 $ WS "}"
4025 $ CS
4026 $ tmp = "ftello"
4027 $ GOSUB inlibc
4028 $ d_ftello = tmp
4029 $!
4030 $!: see if this is a netdb.h system
4031 $ IF Has_Dec_C_Sockets
4032 $ THEN 
4033 $   tmp = "netdb.h"
4034 $   GOSUB inhdr
4035 $   i_netdb = tmp
4036 $ ENDIF
4037 $!
4038 $! Check for h_errno
4039 $!
4040 $ echo4 "Checking to see if you have h_errno..."
4041 $ OS
4042 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4043 $ WS "#include <stdlib.h>"
4044 $ WS "#endif"
4045 $ WS "#include <stdio.h>"
4046 $ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
4047 $ IF i_netdb  .EQS. "define" THEN WS "#include <netdb.h>"
4048 $ WS "int main()"
4049 $ WS "{"
4050 $ WS "h_errno = 3;"
4051 $ WS "exit(0);"
4052 $ WS "}"
4053 $ CS
4054 $ GOSUB link_ok
4055 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4056 $ THEN
4057 $   d_herrno="define"
4058 $   echo "You have h_errno."
4059 $ ELSE
4060 $   d_herrno="undef"
4061 $   echo "You do not have h_errno."
4062 $ ENDIF
4063 $!
4064 $! Check to see if gethostname exists
4065 $!
4066 $ IF Has_Dec_C_Sockets
4067 $ THEN
4068 $   OS
4069 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4070 $   WS "#include <stdlib.h>"
4071 $   WS "#endif"
4072 $   WS "#include <stdio.h>"
4073 $   WS "#include <types.h>"
4074 $   WS "#include <time.h>"
4075 $   WS "#include <socket.h>"
4076 $   WS "int main()"
4077 $   WS "{"
4078 $   WS "char name[100];"
4079 $   WS "int bar, baz;"
4080 $   WS "bar = 100;"
4081 $   WS "baz = gethostname(name, bar);"
4082 $   WS "exit(0);"
4083 $   WS "}"
4084 $   CS
4085 $   GOSUB link_ok
4086 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4087 $   THEN
4088 $     d_gethname="define"
4089 $     echo4 "gethostname() found."
4090 $   ELSE
4091 $     d_gethname="undef"
4092 $   ENDIF
4093 $ ELSE
4094 $   ! No sockets, so no gethname
4095 $   d_gethname = "undef"
4096 $ ENDIF
4097 $!
4098 $! Check for sys/file.h
4099 $!
4100 $ tmp = "sys/file.h"
4101 $ GOSUB inhdr
4102 $ i_sysfile = tmp
4103 $!
4104 $!
4105 $! Check for sys/ioctl.h
4106 $!
4107 $ tmp = "sys/ioctl.h"
4108 $ GOSUB inhdr
4109 $ i_sysioctl = tmp
4110 $!
4111 $! Check for sys/utsname.h
4112 $!
4113 $ tmp = "sys/utsname.h"
4114 $ GOSUB inhdr
4115 $ i_sysutsname = tmp
4116 $!
4117 $! Check for syslog.h
4118 $!
4119 $ tmp = "syslog.h"
4120 $ GOSUB inhdr
4121 $ i_syslog = tmp
4122 $!
4123 $! Check for poll.h
4124 $!
4125 $ tmp = "poll.h"
4126 $ GOSUB inhdr
4127 $ i_poll = tmp
4128 $!
4129 $! Check for sys/uio.h
4130 $!
4131 $ tmp = "sys/uio.h"
4132 $ GOSUB inhdr
4133 $ i_sysuio = tmp
4134 $!
4135 $! Check for sys/mode.h
4136 $!
4137 $ tmp = "sys/mode.h"
4138 $ GOSUB inhdr
4139 $ i_sysmode = tmp
4140 $!
4141 $! Check for poll.h
4142 $!
4143 $ tmp = "sys/poll.h"
4144 $ gosub inhdr
4145 $ i_syspoll = tmp
4146 $!
4147 $! Check for sys/access.h
4148 $!
4149 $ tmp = "sys/access.h"
4150 $ GOSUB inhdr
4151 $ i_sysaccess = tmp
4152 $!
4153 $! Check for sys/security.h
4154 $!
4155 $ tmp = "sys/security.h"
4156 $ GOSUB inhdr
4157 $ i_syssecrt = tmp
4158 $!
4159 $! Check for fcntl.h
4160 $!
4161 $ tmp = "fcntl.h"
4162 $ GOSUB inhdr
4163 $ i_fcntl = tmp
4164 $!
4165 $! Check for fcntl
4166 $!
4167 $ OS
4168 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4169 $ WS "#include <stdlib.h>"
4170 $ WS "#endif"
4171 $ WS "#include <stdio.h>"
4172 $ WS "#include <fcntl.h>"
4173 $ WS "int main()"
4174 $ WS "{"
4175 $ WS "fcntl(1,2,3);"
4176 $ WS "exit(0);"
4177 $ WS "}"
4178 $ CS
4179 $ tmp = "fcntl"
4180 $ GOSUB inlibc
4181 $ d_fcntl = tmp
4182 $!
4183 $! Check for fcntl locking capability
4184 $!
4185 $ echo4 "Checking if fcntl-based file locking works... "
4186 $ tmp = "undef"
4187 $ IF d_fcntl .EQS. "define"
4188 $ THEN
4189 $   OS
4190 $   WS "#include <stdio.h>"
4191 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4192 $   WS "#include <stdlib.h>"
4193 $   WS "#endif"
4194 $   WS "#include <fcntl.h>"
4195 $   WS "#include <unistd.h>"
4196 $   WS "int main() {"
4197 $   WS "#if defined(F_SETLK) && defined(F_SETLKW)"
4198 $   WS "     struct flock flock;"
4199 $   WS "     int retval, fd;"
4200 $   WS "     fd = open(""[-]perl.c"", O_RDONLY);"
4201 $   WS "     flock.l_type = F_RDLCK;"
4202 $   WS "     flock.l_whence = SEEK_SET;"
4203 $   WS "     flock.l_start = flock.l_len = 0;"
4204 $   WS "     retval = fcntl(fd, F_SETLK, &flock);"
4205 $   WS "     close(fd);"
4206 $   WS "     (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
4207 $   WS "#else"
4208 $   WS "     printf(""undef\n"");"
4209 $   WS "#endif"
4210 $   WS "}"
4211 $   CS
4212 $   GOSUB link_ok
4213 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4214 $   THEN
4215 $     GOSUB just_mcr_it
4216 $     IF tmp .EQS. "define"
4217 $     THEN
4218 $       echo4 "Yes, it seems to work."
4219 $     ELSE
4220 $       echo4 "Nope, it didn't work."
4221 $     ENDIF
4222 $   ELSE
4223 $     echo4 "I'm unable to compile the test program, so I'll assume not."
4224 $     tmp = "undef"
4225 $   ENDIF
4226 $ ELSE
4227 $   echo4 "Nope, since you don't even have fcntl()."
4228 $ ENDIF
4229 $ d_fcntl_can_lock = tmp
4230 $!
4231 $! Check to see if isblank exists
4232 $!
4233 $ OS
4234 $ WS "#include <stdlib.h>"
4235 $ WS "#include <ctype.h>"
4236 $ WS "int main()"
4237 $ WS "{"
4238 $ WS "int c = ' ';"
4239 $ WS "if(isblank(c))"
4240 $ WS "    exit(EXIT_SUCCESS);"
4241 $ WS "else"
4242 $ WS "    exit(EXIT_FAILURE);"
4243 $ WS "}"
4244 $ CS
4245 $ tmp = "isblank"
4246 $ GOSUB inlibc
4247 $ d_isblank = tmp
4248 $!
4249 $! Check to see if isless exists
4250 $!
4251 $ OS
4252 $ WS "#include <stdlib.h>"
4253 $ WS "#include <math.h>"
4254 $ WS "int main() { return isless(1.0, 2.0) ? EXIT_SUCCESS : EXIT_FAILURE; }"
4255 $ CS
4256 $ tmp = "isless"
4257 $ GOSUB inlibc
4258 $ d_isless = tmp
4259 $!
4260 $! Check to see if pre-C99 isnanl exists
4261 $!
4262 $ OS
4263 $ WS "#include <stdlib.h>"
4264 $ WS "#include <math.h>"
4265 $ WS "int main()"
4266 $ WS "{"
4267 $ WS "  long double x = NaN;
4268 $ WS "  return isnanl(x) ? EXIT_SUCCESS : EXIT_FAILURE;
4269 $ WS "}"
4270 $ CS
4271 $ tmp = "isnanl"
4272 $ GOSUB inlibc
4273 $ d_isnanl = tmp
4274 $!
4275 $! Check to see if llrint exists
4276 $!
4277 $ OS
4278 $ WS "#include <stdlib.h>"
4279 $ WS "#include <math.h>"
4280 $ WS "int main()"
4281 $ WS "{"
4282 $ WS "  long long x = llrint(1.5);
4283 $ WS "  return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4284 $ WS "}"
4285 $ CS
4286 $ tmp = "llrint"
4287 $ GOSUB inlibc
4288 $ d_llrint = tmp
4289 $!
4290 $! Check to see if llrintl exists
4291 $!
4292 $ OS
4293 $ WS "#include <stdlib.h>"
4294 $ WS "#include <math.h>"
4295 $ WS "int main()"
4296 $ WS "{"
4297 $ WS "  long long x = llrintl(1.5);
4298 $ WS "  return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4299 $ WS "}"
4300 $ CS
4301 $ tmp = "llrintl"
4302 $ GOSUB inlibc
4303 $ d_llrintl = tmp
4304 $!
4305 $! Check to see if llround exists
4306 $!
4307 $ OS
4308 $ WS "#include <stdlib.h>"
4309 $ WS "#include <math.h>"
4310 $ WS "int main()"
4311 $ WS "{"
4312 $ WS "  long long x = llround(1.5);
4313 $ WS "  return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4314 $ WS "}"
4315 $ CS
4316 $ tmp = "llround"
4317 $ GOSUB inlibc
4318 $ d_llround = tmp
4319 $!
4320 $! Check to see if llroundl exists
4321 $!
4322 $ OS
4323 $ WS "#include <stdlib.h>"
4324 $ WS "#include <math.h>"
4325 $ WS "int main()"
4326 $ WS "{"
4327 $ WS "  long long x = llroundl(1.5);
4328 $ WS "  return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4329 $ WS "}"
4330 $ CS
4331 $ tmp = "llroundl"
4332 $ GOSUB inlibc
4333 $ d_llroundl = tmp
4334 $!
4335 $! Check to see if nearbyint exists
4336 $!
4337 $ OS
4338 $ WS "#include <stdlib.h>"
4339 $ WS "#include <math.h>"
4340 $ WS "int main()"
4341 $ WS "{"
4342 $ WS "  double x = llroundl(1.5);
4343 $ WS "  return x == 2.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4344 $ WS "}"
4345 $ CS
4346 $ tmp = "nearbyint"
4347 $ GOSUB inlibc
4348 $ d_nearbyint = tmp
4349 $!
4350 $! Check to see if round exists
4351 $!
4352 $ OS
4353 $ WS "#include <stdlib.h>"
4354 $ WS "#include <math.h>"
4355 $ WS "int main()"
4356 $ WS "{"
4357 $ WS "  double x = round(1.5);
4358 $ WS "  return x == 2.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4359 $ WS "}"
4360 $ CS
4361 $ tmp = "round"
4362 $ GOSUB inlibc
4363 $ d_round = tmp
4364 $!
4365 $! Check to see if scalbn exists
4366 $!
4367 $ OS
4368 $ WS "#include <stdlib.h>"
4369 $ WS "#include <math.h>"
4370 $ WS "int main()"
4371 $ WS "{"
4372 $ WS "  double x = scalbn(1.0, 3);
4373 $ WS "  return x == 8.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4374 $ WS "}"
4375 $ CS
4376 $ tmp = "scalbn"
4377 $ GOSUB inlibc
4378 $ d_scalbn = tmp
4379 $!
4380 $! Check to see if scalbnl exists
4381 $!
4382 $ OS
4383 $ WS "#include <stdlib.h>"
4384 $ WS "#include <math.h>"
4385 $ WS "int main()"
4386 $ WS "{"
4387 $ WS "  long double x = scalbn(1.0, 3);
4388 $ WS "  return x == 8.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4389 $ WS "}"
4390 $ CS
4391 $ tmp = "scalbnl"
4392 $ GOSUB inlibc
4393 $ d_scalbnl = tmp
4394 $!
4395 $! Check for memrchr
4396 $!
4397 $ OS
4398 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4399 $ WS "#include <stdlib.h>"
4400 $ WS "#endif"
4401 $ WS "#include <string.h>"
4402 $ WS "int main()"
4403 $ WS "{"
4404 $ WS "char * place;"
4405 $ WS "place = (char *)memrchr(""foo"", 47, 3);"
4406 $ WS "exit(0);"
4407 $ WS "}"
4408 $ CS
4409 $ tmp = "memrchr"
4410 $ GOSUB inlibc
4411 $ d_memrchr = tmp
4412 $!
4413 $! Check for strnlen
4414 $!
4415 $ OS
4416 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4417 $ WS "#include <stdlib.h>"
4418 $ WS "#endif"
4419 $ WS "#include <string.h>"
4420 $ WS "int main()"
4421 $ WS "{"
4422 $ WS "size_t len;"
4423 $ WS "len = strnlen(""foot"", 3);"
4424 $ WS "exit(0);"
4425 $ WS "}"
4426 $ CS
4427 $ tmp = "strnlen"
4428 $ GOSUB inlibc
4429 $ d_strnlen = tmp
4430 $!
4431 $! Check for strtoull
4432 $!
4433 $ OS
4434 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4435 $ WS "#include <stdlib.h>"
4436 $ WS "#endif"
4437 $ WS "#include <string.h>"
4438 $ WS "int main()"
4439 $ WS "{"
4440 $ WS "unsigned __int64 result;"
4441 $ WS "result = strtoull(""123123"", NULL, 10);"
4442 $ WS "exit(0);"
4443 $ WS "}"
4444 $ CS
4445 $ tmp = "strtoull"
4446 $ GOSUB inlibc
4447 $ d_strtoull = tmp
4448 $!
4449 $! Check for strtouq
4450 $!
4451 $ OS
4452 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4453 $ WS "#include <stdlib.h>"
4454 $ WS "#endif"
4455 $ WS "#include <string.h>"
4456 $ WS "int main()"
4457 $ WS "{"
4458 $ WS "unsigned __int64 result;"
4459 $ WS "result = strtouq(""123123"", NULL, 10);"
4460 $ WS "exit(0);"
4461 $ WS "}"
4462 $ CS
4463 $ tmp = "strtouq"
4464 $ GOSUB inlibc
4465 $ d_strtouq = tmp
4466 $!
4467 $! Check for strtoll
4468 $!
4469 $ OS
4470 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4471 $ WS "#include <stdlib.h>"
4472 $ WS "#endif"
4473 $ WS "#include <string.h>"
4474 $ WS "int main()"
4475 $ WS "{"
4476 $ WS "__int64 result;"
4477 $ WS "result = strtoll(""123123"", NULL, 10);"
4478 $ WS "exit(0);"
4479 $ WS "}"
4480 $ CS
4481 $ tmp = "strtoll"
4482 $ GOSUB inlibc
4483 $ d_strtoll = tmp
4484 $!
4485 $! Check for strtoq
4486 $!
4487 $ OS
4488 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4489 $ WS "#include <stdlib.h>"
4490 $ WS "#endif"
4491 $ WS "#include <string.h>"
4492 $ WS "int main()"
4493 $ WS "{"
4494 $ WS "__int64 result;"
4495 $ WS "result = strtoq(""123123"", NULL, 10);"
4496 $ WS "exit(0);"
4497 $ WS "}"
4498 $ CS
4499 $ tmp = "strtoq"
4500 $ GOSUB inlibc
4501 $ d_strtoq = tmp
4502 $!
4503 $! Check for strtold
4504 $!
4505 $ OS
4506 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4507 $ WS "#include <stdlib.h>"
4508 $ WS "#endif"
4509 $ WS "#include <string.h>"
4510 $ WS "int main()"
4511 $ WS "{"
4512 $ WS "long double result;"
4513 $ WS "result = strtold(""123123"", NULL);"
4514 $ WS "exit(0);"
4515 $ WS "}"
4516 $ CS
4517 $ tmp = "strtold"
4518 $ GOSUB inlibc
4519 $ d_strtold = tmp
4520 $!
4521 $! Check for atoll
4522 $!
4523 $ OS
4524 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4525 $ WS "#include <stdlib.h>"
4526 $ WS "#endif"
4527 $ WS "#include <string.h>"
4528 $ WS "int main()"
4529 $ WS "{"
4530 $ WS " __int64 result;"
4531 $ WS "result = atoll(""123123"");"
4532 $ WS "exit(0);"
4533 $ WS "}"
4534 $ CS
4535 $ tmp = "atoll"
4536 $ GOSUB inlibc
4537 $ d_atoll = tmp
4538 $!
4539 $! Check for atolf
4540 $!
4541 $ OS
4542 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4543 $ WS "#include <stdlib.h>"
4544 $ WS "#endif"
4545 $ WS "#include <string.h>"
4546 $ WS "int main()"
4547 $ WS "{"
4548 $ WS "long double"
4549 $ WS "result = atolf(""123123"");"
4550 $ WS "exit(0);"
4551 $ WS "}"
4552 $ CS
4553 $ tmp = "atolf"
4554 $ GOSUB inlibc
4555 $ d_atolf = tmp
4556 $!
4557 $! Check for access
4558 $!
4559 $ OS
4560 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4561 $ WS "#include <stdlib.h>"
4562 $ WS "#endif"
4563 $ WS "#include <stdio.h>"
4564 $ WS "int main()"
4565 $ WS "{"
4566 $ WS "access(""foo"", F_OK);"
4567 $ WS "exit(0);"
4568 $ WS "}"
4569 $ CS
4570 $ tmp = "acess"
4571 $ GOSUB inlibc
4572 $ d_access = tmp
4573 $!
4574 $! Check for mkstemp
4575 $!
4576 $ OS
4577 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4578 $ WS "#include <stdlib.h>"
4579 $ WS "#endif"
4580 $ WS "#include <stdio.h>"
4581 $ WS "int main()"
4582 $ WS "{"
4583 $ WS "mkstemp(""foo"");"
4584 $ WS "exit(0);"
4585 $ WS "}"
4586 $ CS
4587 $ tmp = "mkstemp"
4588 $ GOSUB inlibc
4589 $ d_mkstemp = tmp
4590 $!
4591 $! Check for mkstemps
4592 $!
4593 $ OS
4594 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4595 $ WS "#include <stdlib.h>"
4596 $ WS "#endif"
4597 $ WS "#include <stdio.h>"
4598 $ WS "int main()"
4599 $ WS "{"
4600 $ WS "mkstemps(""foo"", 1);"
4601 $ WS "exit(0);"
4602 $ WS "}"
4603 $ CS
4604 $ tmp = "mkstemps"
4605 $ GOSUB inlibc
4606 $ d_mkstemps = tmp
4607 $!
4608 $! Check for mkdtemp
4609 $!
4610 $ OS
4611 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4612 $ WS "#include <stdlib.h>"
4613 $ WS "#endif"
4614 $ WS "#include <stdio.h>"
4615 $ WS "int main()"
4616 $ WS "{"
4617 $ WS "mkdtemp(""foo"");"
4618 $ WS "exit(0);"
4619 $ WS "}"
4620 $ CS
4621 $ tmp = "mkdtemp"
4622 $ GOSUB inlibc
4623 $ d_mkdtemp = tmp
4624 $!
4625 $! Check for poll
4626 $!
4627 $ if i_poll .eqs. "define"
4628 $ then
4629 $   OS
4630 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4631 $   WS "#include <stdlib.h>"
4632 $   WS "#endif"
4633 $   WS "#include <poll.h>"
4634 $   WS "int main()"
4635 $   WS "{"
4636 $   WS "struct pollfd pfd;"
4637 $   WS "int count=poll(&pfd,1,0);"
4638 $   WS "exit(0);"
4639 $   WS "}"
4640 $   CS
4641 $   tmp = "poll"
4642 $   GOSUB inlibc
4643 $   d_poll = tmp
4644 $ else
4645 $   d_poll = "undef"
4646 $ endif
4647 $!
4648 $! Check for setvbuf
4649 $!
4650 $ OS
4651 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4652 $ WS "#include <stdlib.h>"
4653 $ WS "#endif"
4654 $ WS "#include <stdio.h>"
4655 $ WS "int main()"
4656 $ WS "{"
4657 $ WS "FILE *foo;"
4658 $ WS "char Buffer[99];"
4659 $ WS "foo = fopen(""foo"", ""r"");"
4660 $ WS "setvbuf(foo, Buffer, 0, 0);"
4661 $ WS "exit(0);"
4662 $ WS "}"
4663 $ CS
4664 $ tmp = "setvbuf"
4665 $ GOSUB inlibc
4666 $ d_setvbuf = tmp
4667 $!
4668 $! Check for the shm* routines.
4669 $!
4670 $ OS
4671 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4672 $ WS "#include <stdlib.h>"
4673 $ WS "#endif"
4674 $ WS "#include <stdio.h>"
4675 $ WS "#include <sys/shm.h>"
4676 $ WS "#include <sys/stat.h>"
4677 $ WS "int shmget(key_t key, size_t size, int shmflg);"
4678 $ WS "void* shmat(int shmid,const void *shmaddr,int shmflg);"
4679 $ WS "int shmctl(int shmid,  int cmd, struct shmid_ds *buf);"
4680 $ WS "int shmdt(const void *shmaddr);"
4681 $ WS "int main() {"
4682 $ WS "int shm_id = shmget(IPC_PRIVATE, 8, S_IRWXU);"
4683 $ WS "if (shm_id == -1) printf(""0\n""); else printf (""1\n"");"
4684 $ WS "}"
4685 $ CS
4686 $ GOSUB compile
4687 $ IF tmp .EQS. "1"
4688 $ THEN
4689 $   d_shm = "define"
4690 $   d_shmat = "define"
4691 $   d_shmatprototype = "define"
4692 $   d_shmctl = "define"
4693 $   d_shmdt = "define"
4694 $   d_shmget = "define"
4695 $   shmattype = "void *"
4696 $ ELSE
4697 $   d_shm = "undef"
4698 $   d_shmat = "undef"
4699 $   d_shmatprototype = "undef"
4700 $   d_shmctl = "undef"
4701 $   d_shmdt = "undef"
4702 $   d_shmget = "undef"
4703 $   shmattype = "undef"
4704 $ ENDIF
4705 $!
4706 $! Check for setenv
4707 $!
4708 $ OS
4709 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4710 $ WS "#include <stdlib.h>"
4711 $ WS "#endif"
4712 $ WS "#include <stdio.h>"
4713 $ WS "int main()"
4714 $ WS "{"
4715 $ WS "setenv(""FOO"", ""BAR"", 0);"
4716 $ WS "exit(0);"
4717 $ WS "}"
4718 $ CS
4719 $ tmp = "setenv"
4720 $ GOSUB inlibc
4721 $ d_setenv = tmp
4722 $!
4723 $! Check for setproctitle
4724 $!
4725 $ OS
4726 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4727 $ WS "#include <stdlib.h>"
4728 $ WS "#endif"
4729 $ WS "#include <stdio.h>"
4730 $ WS "int main()"
4731 $ WS "{"
4732 $ WS "setproctitle(""%s"", ""FOO"");"
4733 $ WS "exit(0);"
4734 $ WS "}"
4735 $ CS
4736 $ tmp = "setproctitle"
4737 $ GOSUB inlibc
4738 $ d_setproctitle = tmp
4739 $!
4740 $! Check for <netinet/in.h>
4741 $!
4742 $ IF Has_Dec_C_Sockets
4743 $ THEN
4744 $   tmp = "netinet/in.h"
4745 $   GOSUB inhdr
4746 $   i_niin = tmp
4747 $ ELSE
4748 $   i_niin="undef"
4749 $ ENDIF
4750 $!
4751 $! Check for <arpa/inet.h>
4752 $!
4753 $ IF Has_Dec_C_Sockets
4754 $ THEN
4755 $   tmp = "arpa/inet.h"
4756 $   GOSUB inhdr
4757 $   i_arpainet = tmp
4758 $ ELSE
4759 $   i_arpainet="undef"
4760 $ ENDIF
4761 $!
4762 $! Check for <sys/un.h>
4763 $!
4764 $ IF Has_Dec_C_Sockets
4765 $ THEN
4766 $   tmp = "sys/un.h"
4767 $   GOSUB inhdr
4768 $   i_sysun = tmp
4769 $ ELSE
4770 $   i_sysun="undef"
4771 $ ENDIF
4772 $!
4773 $!
4774 $! Check for <netinet/tcp.h>
4775 $!
4776 $ IF Has_Dec_C_Sockets
4777 $ THEN
4778 $   tmp = "netinet/tcp.h"
4779 $   GOSUB inhdr
4780 $   i_netinettcp = tmp
4781 $ ELSE
4782 $   i_netinettcp="undef"
4783 $ ENDIF
4784 $!
4785 $! Check for endhostent
4786 $!
4787 $ IF Has_Dec_C_Sockets
4788 $ THEN
4789 $   OS
4790 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4791 $   WS "#include <stdlib.h>"
4792 $   WS "#endif"
4793 $   WS "#include <stdio.h>"
4794 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4795 $   WS "int main()"
4796 $   WS "{"
4797 $   WS "endhostent();"
4798 $   WS "exit(0);"
4799 $   WS "}"
4800 $   CS
4801 $   tmp = "endhostent"
4802 $   GOSUB inlibc
4803 $   d_endhent = tmp
4804 $ ELSE
4805 $   d_endhent="undef"
4806 $ ENDIF
4807 $!
4808 $! Check for endnetent
4809 $!
4810 $ IF Has_Dec_C_Sockets
4811 $ THEN
4812 $   OS
4813 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4814 $   WS "#include <stdlib.h>"
4815 $   WS "#endif"
4816 $   WS "#include <stdio.h>"
4817 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4818 $   WS "int main()"
4819 $   WS "{"
4820 $   WS "endnetent();"
4821 $   WS "exit(0);"
4822 $   WS "}"
4823 $   CS
4824 $   tmp = "endnetent"
4825 $   GOSUB inlibc
4826 $   d_endnent = tmp
4827 $ ELSE
4828 $   d_endnent="undef"
4829 $ ENDIF
4830 $!
4831 $! Check for endprotoent
4832 $!
4833 $ IF Has_Dec_C_Sockets
4834 $ THEN
4835 $   OS
4836 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4837 $   WS "#include <stdlib.h>"
4838 $   WS "#endif"
4839 $   WS "#include <stdio.h>"
4840 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4841 $   WS "int main()"
4842 $   WS "{"
4843 $   WS "endprotoent();"
4844 $   WS "exit(0);"
4845 $   WS "}"
4846 $   CS
4847 $   tmp = "endprotoent"
4848 $   GOSUB inlibc
4849 $   d_endpent = tmp
4850 $ ELSE
4851 $   d_endpent="undef"
4852 $ ENDIF
4853 $!
4854 $! Check for endservent
4855 $!
4856 $ IF Has_Dec_C_Sockets
4857 $ THEN
4858 $   OS
4859 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4860 $   WS "#include <stdlib.h>"
4861 $   WS "#endif"
4862 $   WS "#include <stdio.h>"
4863 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4864 $   WS "int main()"
4865 $   WS "{"
4866 $   WS "endservent();"
4867 $   WS "exit(0);"
4868 $   WS "}"
4869 $   CS
4870 $   tmp = "endservent"
4871 $   GOSUB inlibc
4872 $   d_endsent = tmp
4873 $ ELSE
4874 $   d_endsent="undef"
4875 $ ENDIF
4876 $!
4877 $! Check for sethostent
4878 $!
4879 $ IF Has_Dec_C_Sockets
4880 $ THEN
4881 $   OS
4882 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4883 $   WS "#include <stdlib.h>"
4884 $   WS "#endif"
4885 $   WS "#include <stdio.h>"
4886 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4887 $   WS "int main()"
4888 $   WS "{"
4889 $   WS "sethostent(1);"
4890 $   WS "exit(0);"
4891 $   WS "}"
4892 $   CS
4893 $   tmp = "sethostent"
4894 $   GOSUB inlibc
4895 $   d_sethent = tmp
4896 $ ELSE
4897 $   d_sethent="undef"
4898 $ ENDIF
4899 $!
4900 $! Check for setnetent
4901 $!
4902 $ IF Has_Dec_C_Sockets
4903 $ THEN
4904 $   OS
4905 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4906 $   WS "#include <stdlib.h>"
4907 $   WS "#endif"
4908 $   WS "#include <stdio.h>"
4909 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4910 $   WS "int main()"
4911 $   WS "{"
4912 $   WS "setnetent(1);"
4913 $   WS "exit(0);"
4914 $   WS "}"
4915 $   CS
4916 $   tmp = "setnetent"
4917 $   GOSUB inlibc
4918 $   d_setnent = tmp
4919 $ ELSE
4920 $   d_setnent="undef"
4921 $ ENDIF
4922 $!
4923 $! Check for setprotoent
4924 $!
4925 $ IF Has_Dec_C_Sockets
4926 $ THEN
4927 $   OS
4928 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4929 $   WS "#include <stdlib.h>"
4930 $   WS "#endif"
4931 $   WS "#include <stdio.h>"
4932 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4933 $   WS "int main()"
4934 $   WS "{"
4935 $   WS "setprotoent(1);"
4936 $   WS "exit(0);"
4937 $   WS "}"
4938 $   CS
4939 $   tmp = "setprotoent"
4940 $   GOSUB inlibc
4941 $   d_setpent = tmp
4942 $ ELSE
4943 $   d_setpent="undef"
4944 $ ENDIF
4945 $!
4946 $! Check for setservent
4947 $!
4948 $ IF Has_Dec_C_Sockets
4949 $ THEN
4950 $   OS
4951 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4952 $   WS "#include <stdlib.h>"
4953 $   WS "#endif"
4954 $   WS "#include <stdio.h>"
4955 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4956 $   WS "int main()"
4957 $   WS "{"
4958 $   WS "setservent(1);"
4959 $   WS "exit(0);"
4960 $   WS "}"
4961 $   CS
4962 $   tmp = "setservent"
4963 $   GOSUB inlibc
4964 $   d_setsent = tmp
4965 $ ELSE
4966 $   d_setsent="undef"
4967 $ ENDIF
4968 $!
4969 $! Check for gethostent
4970 $!
4971 $ IF Has_Dec_C_Sockets
4972 $ THEN
4973 $   OS
4974 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4975 $   WS "#include <stdlib.h>"
4976 $   WS "#endif"
4977 $   WS "#include <stdio.h>"
4978 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4979 $   WS "int main()"
4980 $   WS "{"
4981 $   WS "gethostent();"
4982 $   WS "exit(0);"
4983 $   WS "}"
4984 $   CS
4985 $   tmp = "gethostent"
4986 $   GOSUB inlibc
4987 $   d_gethent = tmp
4988 $ ELSE
4989 $   d_gethent="undef"
4990 $ ENDIF
4991 $!
4992 $! Check for getnetent
4993 $!
4994 $ IF Has_Dec_C_Sockets
4995 $ THEN
4996 $   OS
4997 $   WS "#if defined(__DECC) || defined(__DECCXX)"
4998 $   WS "#include <stdlib.h>"
4999 $   WS "#endif"
5000 $   WS "#include <stdio.h>"
5001 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
5002 $   WS "int main()"
5003 $   WS "{"
5004 $   WS "getnetent();"
5005 $   WS "exit(0);"
5006 $   WS "}"
5007 $   CS
5008 $   tmp = "getnetent"
5009 $   GOSUB inlibc
5010 $   d_getnent = tmp
5011 $ ELSE
5012 $   d_getnent="undef"
5013 $ ENDIF
5014 $!
5015 $! Check for getprotoent
5016 $!
5017 $ IF Has_Dec_C_Sockets
5018 $ THEN
5019 $   OS
5020 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5021 $   WS "#include <stdlib.h>"
5022 $   WS "#endif"
5023 $   WS "#include <stdio.h>"
5024 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
5025 $   WS "int main()"
5026 $   WS "{"
5027 $   WS "getprotoent();"
5028 $   WS "exit(0);"
5029 $   WS "}"
5030 $   CS
5031 $   tmp = "getprotoent"
5032 $   GOSUB inlibc
5033 $   d_getpent = tmp
5034 $ ELSE
5035 $   d_getpent="undef"
5036 $ ENDIF
5037 $!
5038 $! Check for getservent
5039 $!
5040 $ IF Has_Dec_C_Sockets
5041 $ THEN
5042 $   OS
5043 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5044 $   WS "#include <stdlib.h>"
5045 $   WS "#endif"
5046 $   WS "#include <stdio.h>"
5047 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
5048 $   WS "int main()"
5049 $   WS "{"
5050 $   WS "getservent();"
5051 $   WS "exit(0);"
5052 $   WS "}"
5053 $   CS
5054 $   tmp = "getservent"
5055 $   GOSUB inlibc
5056 $   d_getsent = tmp
5057 $ ELSE
5058 $   d_getsent="undef"
5059 $ ENDIF
5060 $!
5061 $!
5062 $! Check for sa_len
5063 $!
5064 $ echo4 "Checking the availability of sa_len in the sockaddr struct ..."
5065 $ IF Has_Dec_C_Sockets
5066 $ THEN
5067 $   OS
5068 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5069 $   WS "#include <stdlib.h>"
5070 $   WS "#endif"
5071 $   WS "#define _SOCKADDR_LEN"
5072 $   WS "#include <types.h>"
5073 $   WS "#include <socket.h>"
5074 $   WS "#include <string.h>"
5075 $   WS "int main() {"
5076 $   WS "struct sockaddr sa;"
5077 $   WS "memset((char *)&sa, 0, sizeof(sa));"
5078 $   WS "return (sa.sa_len);"
5079 $   WS "}"
5080 $   CS
5081 $   GOSUB compile_ok
5082 $   IF compile_status .EQ. good_compile
5083 $   THEN
5084 $     d_sockaddr_sa_len="define"
5085 $     echo "You have sa_len in the sockaddr struct."
5086 $   ELSE
5087 $     d_sockaddr_sa_len="undef"
5088 $     echo "You do not have sa_len in the sockaddr struct."
5089 $   ENDIF
5090 $ ELSE
5091 $   d_sockaddr_sa_len="undef"
5092 $   echo "You do not have sa_len in the sockaddr struct."
5093 $ ENDIF
5094 $!
5095 $! Check for sin6_scope_id
5096 $!
5097 $ echo4 "Checking the availability of sin6_scope_id in the struct sockaddr_in6 ..."
5098 $ IF Has_Dec_C_Sockets
5099 $ THEN
5100 $   OS
5101 $   WS "#include <types.h>"
5102 $   WS "#include <socket.h>"
5103 $   WS "#include <in.h>"
5104 $   WS "#include <string.h>"
5105 $   WS "int main() {"
5106 $   WS "struct sockaddr_in6 sin6;"
5107 $   WS "memset((char *)&sin6, 0, sizeof(sin6));"
5108 $   WS "return (sin6.sin6_scope_id);"
5109 $   WS "}"
5110 $   CS
5111 $   GOSUB compile_ok
5112 $   IF compile_status .EQ. good_compile
5113 $   THEN
5114 $     d_sin6_scope_id="define"
5115 $     echo "You have sin6_scope_id in the sockaddr_in6 struct."
5116 $   ELSE
5117 $     d_sin6_scope_id="undef"
5118 $     echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
5119 $   ENDIF
5120 $ ELSE
5121 $   d_sin6_scope_id="undef"
5122 $   echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
5123 $ ENDIF
5124 $!
5125 $! Check for nanosleep
5126 $!
5127 $ OS
5128 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5129 $ WS "#include <stdlib.h>"
5130 $ WS "#endif"
5131 $ WS "#include <time.h>"
5132 $ WS "int main()"
5133 $ WS "{"
5134 $ WS "int asleep = nanosleep(NULL,NULL);"
5135 $ WS "exit(0);"
5136 $ WS "}"
5137 $ CS
5138 $ tmp = "nanosleep"
5139 $ GOSUB inlibc
5140 $ d_nanosleep = tmp
5141 $!
5142 $! Check for socklen_t
5143 $!
5144 $ IF Has_Dec_C_Sockets
5145 $ THEN
5146 $   echo4 "Checking to see if you have socklen_t..."
5147 $   OS
5148 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5149 $   WS "#include <stdlib.h>"
5150 $   WS "#endif"
5151 $   WS "#include <stdio.h>"
5152 $   IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
5153 $   WS "int main()"
5154 $   WS "{"
5155 $   WS "socklen_t x = 16;"
5156 $   WS "exit(0);"
5157 $   WS "}"
5158 $   CS
5159 $   GOSUB link_ok
5160 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5161 $   THEN
5162 $     d_socklen_t="define"
5163 $     echo "You have socklen_t."
5164 $   ELSE
5165 $     d_socklen_t="undef"
5166 $     echo "You do not have socklen_t."
5167 $   ENDIF
5168 $ ELSE
5169 $   d_socklen_t="undef"
5170 $ ENDIF
5171 $!
5172 $! Check for pthread_yield
5173 $!
5174 $ IF use_threads
5175 $ THEN
5176 $   OS
5177 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5178 $   WS "#include <stdlib.h>"
5179 $   WS "#endif"
5180 $   WS "#include <pthread.h>"
5181 $   WS "#include <stdio.h>"
5182 $   WS "int main()"
5183 $   WS "{"
5184 $   WS "pthread_yield();"
5185 $   WS "exit(0);"
5186 $   WS "}"
5187 $   CS
5188 $   tmp = "pthread_yield"
5189 $   GOSUB inlibc
5190 $   d_pthread_yield = tmp
5191 $ ELSE
5192 $   d_pthread_yield="undef"
5193 $ ENDIF
5194 $!
5195 $! Check for sched_yield
5196 $!
5197 $ IF use_threads
5198 $ THEN
5199 $   OS
5200 $   WS "#if defined(__DECC) || defined(__DECCXX)"
5201 $   WS "#include <stdlib.h>"
5202 $   WS "#endif"
5203 $   WS "#include <pthread.h>"
5204 $   WS "#include <stdio.h>"
5205 $   WS "int main()"
5206 $   WS "{"
5207 $   WS "sched_yield();"
5208 $   WS "exit(0);"
5209 $   WS "}"
5210 $   CS
5211 $   tmp = "sched_yield"
5212 $   GOSUB inlibc
5213 $   d_sched_yield = tmp
5214 $   IF d_sched_yield .EQS. "define"
5215 $   THEN sched_yield = "sched_yield"
5216 $   ELSE sched_yield = " "
5217 $   ENDIF
5218 $ ELSE
5219 $   d_sched_yield="undef"
5220 $   sched_yield = " "
5221 $ ENDIF
5222 $!
5223 $! Check for pthread_attr_setscope and PTHREAD_SCOPE_SYSTEM.
5224 $! (The actual test is to be written.)
5225 $!
5226 $ d_pthread_attr_setscope="undef"
5227 $!
5228 $! Check for generic pointer size
5229 $!
5230 $ echo4 "Checking to see how big your pointers are..." 
5231 $ OS
5232 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5233 $ WS "#include <stdlib.h>"
5234 $ WS "#endif"
5235 $ WS "#include <stdio.h>"
5236 $ WS "int main()"
5237 $ WS "{"
5238 $ WS "int foo;"
5239 $ WS "foo = sizeof(char *);"
5240 $ WS "printf(""%d\n"", foo);"
5241 $ WS "exit(0);"
5242 $ WS "}"
5243 $ CS
5244 $ tmp = "char *"
5245 $ GOSUB type_size_check
5246 $ ptrsize = tmp
5247 $ echo "Your pointers are ''ptrsize' bytes long."
5248 $!
5249 $! Check for size_t size
5250 $!
5251 $ tmp = "size_t"
5252 $ zzz = tmp
5253 $ echo4 "Checking the size of ''zzz'..."
5254 $ GOSUB type_size_check
5255 $ sizesize = tmp
5256 $ echo "Your ''zzz' size is ''sizesize' bytes."
5257 $!
5258 $! Check for _LARGEFILE capability.
5259 $!
5260 $ off_t_size = 4
5261 $ OS
5262 $ WS "#define _LARGEFILE"
5263 $ WS "#include <stdio.h>"
5264 $ WS "int main()"
5265 $ WS "{"
5266 $ WS "printf(""%d\n"", sizeof(off_t));"
5267 $ WS "return(0);"
5268 $ WS "}"
5269 $ CS
5270 $ GOSUB link_ok
5271 $ IF link_status .EQ. good_link
5272 $ THEN
5273 $   GOSUB just_mcr_it
5274 $   off_t_size = tmp
5275 $ ENDIF
5276 $ echo "Your off_t size is ''off_t_size' bytes when _LARGEFILE is defined."
5277 $ IF off_t_size .ne. 8 .AND. (uselargefiles .OR. uselargefiles .eqs. "define")
5278 $ THEN
5279 $   echo4 "You configured with -Duselargefiles but your CRTL does not support _LARGEFILE."
5280 $   echo4 "I'm disabling large file support."
5281 $   uselargefiles = "undef"
5282 $ ENDIF
5283 $!
5284 $! Check for st_ino size.
5285 $!
5286 $ st_ino_size = 4
5287 $ OS
5288 $ WS "#include <sys/stat.h>"
5289 $ WS "#include <stdio.h>"
5290 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5291 $ WS "#include <stdlib.h>
5292 $ WS "#endif"
5293 $ WS "int main() {
5294 $ WS "#''uselargefiles' _LARGEFILE"
5295 $ WS "#ifdef _LARGEFILE"
5296 $ WS "    printf(""%d\n"", sizeof(__ino64_t));"
5297 $ WS "#else"
5298 $ WS "    printf(""%d\n"", sizeof(unsigned short)*3);"
5299 $ WS "#endif"
5300 $ WS "    exit(0);"
5301 $ WS "}"
5302 $ CS
5303 $ GOSUB link_ok
5304 $ IF link_status .EQ. good_link
5305 $ THEN
5306 $   GOSUB just_mcr_it
5307 $   st_ino_size = tmp
5308 $ ENDIF
5309 $ echo "Your st_ino size is ''st_ino_size' bytes."
5310 $!
5311 $! Tests for hard link, symbolic links, and 7.3 + CRTL features
5312 $!
5313 $  d_lchown = "undef"
5314 $  d_link = "undef"
5315 $  d_lstat = "undef"
5316 $  d_readlink = "undef"
5317 $  d_symlink = "undef"
5318 $  d_realpath = "undef"
5319 $!
5320 $! Hard link support has been present since 7.3-1 except for the
5321 $! easy to use DCL test to see if hardlinks are enabled on the build
5322 $! disk.  That would require more work to test, and I am only testing
5323 $! this on 8.2, so that is why the 8.2 test.
5324 $!
5325 $  IF (vms_ver .GES. "8.2")
5326 $  THEN
5327 $   IF f$getdvi("SYS$DISK","HARDLINKS_SUPPORTED")
5328 $   THEN
5329 $       echo "I Found 64 bit OpenVMS 8.2 or later, and hard links enabled on build disk."
5330 $       echo "I will build with hard link support"
5331 $       d_link = "define"
5332 $   ELSE
5333 $       echo "I Found 64 bit OpenVMS 8.2 or later, and hard links disabled on build disk."
5334 $       echo "I will not build with hard link support."
5335 $   ENDIF
5336 $  ELSE
5337 $    echo4 "I can not detect if your CRTL and build disk support hard links."
5338 $    echo4 "I am disabling hard link support."
5339 $  ENDIF
5340 $!
5341 $  IF uselargefiles .OR. uselargefiles .eqs. "define"
5342 $  THEN
5343 $    IF (vms_ver .GES. "8.2")
5344 $    THEN
5345 $      echo4 "Largefile support enabled, so enabling standard stat support too."
5346 $      usestdstat = "y"
5347 $      echo4 -
5348    "Looking for the realpath() function to indicate symbolic link support..."
5349 $      OS
5350 $      WS "#include <stdlib.h>"
5351 $      WS "char *realpath(const char *file_name, char * resolved_name, ...);"
5352 $      WS "int main()"
5353 $      WS "{"
5354 $      WS "char result[255];"
5355 $      WS "realpath(""foo"",result);"
5356 $      WS "exit(0);"
5357 $      WS "}"
5358 $      CS
5359 $      GOSUB link_ok
5360 $      IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5361 $      THEN
5362 $        echo -
5363            "Found realpath() which indicates symbolic link support is present."
5364 $        d_lchown = "define"
5365 $        d_lstat = "define"
5366 $        d_readlink = "define"
5367 $        d_symlink = "define"
5368 $!       d_realpath = "define" ! Perl will not put it in the config.h file?
5369 $!      Perl apparently does not use a built in realpath() on other platforms,
5370 $!      but there is a severe performance penatly on OpenVMS to use the Perl
5371 $!      script that implements a realpath().  The d_symlink symbol is used
5372 $!      as a replacement for the d_realpath since they are related and both
5373 $!      were activated by the CRTL at the same time.
5374 $!
5375 $        ELSE
5376 $         echo4 "Your system does not support symbolic links."
5377 $         echo4 "I am disabling symbolic link support."
5378 $       ENDIF
5379 $    ELSE
5380 $       echo4 "Your system does not support symbolic links."
5381 $       echo4 "I am disabling symbolic link support."
5382 $    ENDIF
5383 $  ELSE
5384 $    IF (vms_ver .GES. "8.2")
5385 $    THEN
5386 $       echo4 "-Duselargefiles is required for symbolic link support."
5387 $       echo4 "You did not specify that, so I am disabling symbolic link support."
5388 $    ENDIF
5389 $  ENDIF
5390 $!
5391 $!
5392 $! Check for grp.h -- should be 7.3 and later, but test to be sure
5393 $!
5394 $ tmp = "grp.h"
5395 $ GOSUB inhdr
5396 $ i_grp = tmp
5397 $!
5398 $! VMS V7.3-2 powered options
5399 $! We know that it is only available for V7.3-2 and later on 64 bit platforms.
5400 $!
5401 $  d_getgrgid_r = "undef"
5402 $  getgrgid_r_proto = "0"
5403 $  d_getgrnam_r = "undef"
5404 $  getgrnam_r_proto = "0"
5405 $  d_getpgid = "undef"
5406 $  d_getpgrp = "undef"
5407 $! N.B.  We already have home-grown thread-safe versions of
5408 $!       getpwnam and getpwuid -- no need to use CRTL versions
5409 $  d_getpwnam_r = "undef"
5410 $  getpwnam_r_proto = "0"
5411 $  d_getpwuid_r = "undef"
5412 $  getpwuid_r_proto = "0"
5413 $  echo "Asumming 64-bit OpenVMS ''vms_ver' -- will build with V7.3-2 routines"
5414 $  d_getgrgid_r = "define"
5415 $  getgrgid_r_proto = "1"
5416 $  d_getgrnam_r = "define"
5417 $  getgrnam_r_proto = "1"
5418 $  if d_symlink .or. d_symlink .EQS. "define"
5419 $  then
5420 $!       FIXME: Need to find how to activate this.
5421 $!       d_getpgid = "define"
5422 $!       d_getpgrp = "define"
5423 $  endif
5424 $  d_setgrent = "define"
5425 $  d_ttyname_r = "define"
5426 $  ttyname_r_proto = "1"
5427 $  d_snprintf = "define"
5428 $  d_vsnprintf = "define"
5429 $!
5430 $! VMS V7.3-2 powered options
5431 $! We know that it is only available for V7.3-2 and later on 64 bit platforms.
5432 $! Only implementing right now on 8.2 because that is what I am testing
5433 $! These functions may require POSIX UIDs/GIDs to be active, so I am
5434 $! not activating the features at this time, just preparing this file
5435 $! to easily use them in the future.
5436 $!
5437 $  d_seteuid = "undef"
5438 $  d_setpgid = "undef"
5439 $  d_setpgrp = "undef"
5440 $  d_setregid = "undef"
5441 $  d_setreuid = "undef"
5442 $  d_setsid = "undef"
5443 $  ! Disable this section for now.
5444 $!$  if (vms_ver .GES. "8.2")
5445 $  if .NOT. 1
5446 $  then
5447 $    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 UID setting routines"
5448 $    d_seteuid = "define"
5449 $    d_setpgid = "define"
5450 $    d_setpgrp = "define"
5451 $    d_setregid = "define"
5452 $    d_setreuid = "define"
5453 $    d_setsid = "define"
5454 $  endif
5455 $!
5456 $! VMS V8 powered options
5457 $! We know that it is only available for 8.2 and later on 64 bit platforms.
5458 $!
5459 $  d_fstatvfs = "undef"
5460 $  d_statvfs = "undef"
5461 $  i_sysstatvfs = "undef"
5462 $  if (vms_ver .GES. "8.2")
5463 $  then
5464 $    echo "Found 64 bit OpenVMS ''vms_ver' -- will build with 8.2 routines"
5465 $    d_fstatvfs = "define"
5466 $    d_statvfs = "define"
5467 $    i_sysstatvfs = "define"
5468 $  endif
5469 $!
5470 $! Check rand48 and its ilk
5471 $!
5472 $ echo4 "Using our internal random number implementation..."
5473 $!
5474 $ randfunc = "Perl_drand48"
5475 $ drand01 = "Perl_drand48()"
5476 $ seedfunc = "Perl_drand48_init"
5477 $ randbits = "48"
5478 $ randseedtype = "U32"
5479 $ d_drand48proto = "define"
5480 $!
5481 $! Done with compiler checks. Clean up.
5482 $ IF F$SEARCH("try.c")  .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
5483 $ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
5484 $ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
5485 $ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
5486 $ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
5487 $ IF ccname .EQS. "CXX"
5488 $ THEN
5489 $   CALL Cxx_demangler_cleanup
5490 $ ENDIF
5491 $!
5492 $! Some that are compiler or VMS version sensitive
5493 $!
5494 $! Gnu C stuff
5495 $ IF ccname .EQS. "GCC"
5496 $ THEN
5497 $   d_attribut="define"
5498 $   vms_cc_type="gcc"
5499 $ ELSE
5500 $   IF ccname .EQS. "CXX"
5501 $   THEN
5502 $      vms_cc_type="cxx"
5503 $   ELSE
5504 $      vms_cc_type="cc"
5505 $   ENDIF
5506 $   d_attribut="undef"
5507 $ ENDIF
5508 $!
5509 $ d_getitimer="define"
5510 $ d_gettimeod="define"
5511 $ d_mmap="define"
5512 $ d_mprotect="define"
5513 $ d_munmap="define"
5514 $ d_msync="define"
5515 $ d_ualarm="define"
5516 $ d_uname="define"
5517 $! d_unsetenv="define" ! Fix me - Activating requires changing VMS code
5518 $ d_unsetenv="undef"   ! Change will be needed to allow GNV integration
5519 $ d_clearenv="undef"
5520 $ d_usleep="define"
5521 $ d_setitimer="define"
5522 $ d_sigaction="define"
5523 $ d_siginfo_si_addr="define"
5524 $ d_siginfo_si_band="define"
5525 $ d_siginfo_si_errno="define"
5526 $ d_siginfo_si_fd="define"
5527 $ d_siginfo_si_pid="define"
5528 $ d_siginfo_si_status="define"
5529 $ d_siginfo_si_uid="define"
5530 $ d_siginfo_si_value="define"
5531 $ d_sigprocmask="define"
5532 $ d_truncate="define"
5533 $ d_wait4="define"
5534 $ d_index="define"
5535 $ pidtype="pid_t"
5536 $ sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
5537 $ sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
5538 $ sig_name2 = sig_name2 + " NUM27 WINCH"
5539 $!* signal.h defines SIGRTMIN as 33 and SIGRTMAX as 64, but there is no 
5540 $!* sigqueue function or other apparent means to do realtime signalling,
5541 $!* so let's not try to include the realtime range for now.
5542 $!* sig_name3=" NUM29 NUM30 NUM31 NUM32 RTMIN NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43"
5543 $!* sig_name4=" NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58"
5544 $!* sig_name5=" NUM59 NUM60 NUM61 NUMT62 NUM63 RTMAX"
5545 $ sig_name = sig_name1 + sig_name2
5546 $ sig_num = ""
5547 $ sig_num_init = ""
5548 $ sig_name_init = ""
5549 $ sig_index = 0
5550 $!
5551 $ PARSE_SIG_NAME_LOOP:
5552 $!
5553 $   tmp = F$ELEMENT(sig_index, " ", sig_name)
5554 $   IF F$LENGTH(F$EDIT(tmp,"TRIM")) .eq. 0 THEN GOTO END_SIG_NAME_LOOP
5555 $   sig_name_init = sig_name_init + """''tmp'"","
5556 $   sig_num = sig_num + "''sig_index' "
5557 $   sig_num_init = sig_num_init + "''sig_index',"
5558 $   sig_index = sig_index + 1
5559 $   GOTO PARSE_SIG_NAME_LOOP
5560 $!
5561 $ END_SIG_NAME_LOOP:
5562 $!
5563 $   sig_name_init = sig_name_init + "0"
5564 $   sig_num_init = sig_num_init + "0"
5565 $   sig_size = "''sig_index'"
5566 $   sig_index = sig_index - 1
5567 $   sig_count = "''sig_index'"
5568 $   uidtype="uid_t"
5569 $   d_pathconf="define"
5570 $   d_fpathconf="define"
5571 $   d_sysconf="define"
5572 $   d_sigsetjmp="define"
5573 $!
5574 $!: see if tzname[] exists
5575 $ OS
5576 $ WS "#include <stdio.h>"
5577 $ WS "#include <time.h>"
5578 $ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
5579 $ CS
5580 $ GOSUB compile_ok
5581 $ IF compile_status .EQ. good_compile
5582 $ THEN
5583 $   d_tzname = "undef"
5584 $   echo4 "tzname[] NOT found."
5585 $ ELSE
5586 $   d_tzname = "define"
5587 $   echo4 "tzname[] found."
5588 $ ENDIF
5589 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
5590 $!
5591 $ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
5592 $ THEN
5593 $   d_phostname="define"
5594 $ ELSE
5595 $   d_phostname="undef"
5596 $ ENDIF
5597 $!
5598 $! Dec C alone
5599 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
5600 $ THEN
5601 $   vms_cc_type="decc"
5602 $ ENDIF
5603 $ d_faststdio="define"
5604 $ d_ffs="undef"
5605 $ d_ffsl="undef"
5606 $ d_getenv_preserves_other_thread="define"
5607 $ d_locconv="define"
5608 $ d_mblen="define"
5609 $ d_mbstowcs="define"
5610 $ d_mbtowc="define"
5611 $ d_mktime="define"
5612 $ d_nl_langinfo="define"
5613 $ d_non_int_bitfields="define"
5614 $ d_setlocale="define"
5615 $ d_setlocale_accepts_any_locale_name="undef"
5616 $ d_stdiobase="define"
5617 $ d_stdio_cnt_lval="define"
5618 $ d_stdio_ptr_lval="define"
5619 $ d_stdstdio="define"
5620 $ d_strcoll="define"
5621 $ d_strxfrm="define"
5622 $ d_strxfrm_l="undef"
5623 $ i_langinfo="define"
5624 $ i_locale="define"
5625 $ d_stdio_ptr_lval_sets_cnt="undef"
5626 $ d_stdio_ptr_lval_nochange_cnt="define"
5627 $ usefaststdio="undef"
5628 $!
5629 $! Sockets?
5630 $ if Has_Dec_C_Sockets
5631 $ THEN
5632 $   d_vms_do_sockets="define"
5633 $   d_htonl="define"
5634 $   d_socket="define"
5635 $   d_sockpair = "undef"
5636 $   if (vms_ver .GES. "8.2")
5637 $   then
5638 $     echo "Found 64 bit OpenVMS 8.2, will build with socketpair support"
5639 $     d_sockpair = "define"
5640 $   endif
5641 $   d_select="define"
5642 $   netdb_hlen_type="int"
5643 $   netdb_host_type="char *"
5644 $   netdb_name_type="char *"
5645 $   netdb_net_type="long"
5646 $   d_gethbyaddr="define"
5647 $   d_gethbyname="define"
5648 $   d_getnbyaddr="define"
5649 $   d_getnbyname="define"
5650 $   d_getpbynumber="define"
5651 $   d_getpbyname="define"
5652 $   d_getsbyport="define"
5653 $   d_getsbyname="define"
5654 $   d_gethostprotos="define"
5655 $   d_getnetprotos="define"
5656 $   d_getprotoprotos="define"
5657 $   d_getservprotos="define"
5658 $   socksizetype="size_t"
5659 $ ELSE
5660 $   d_vms_do_sockets="undef"
5661 $   d_htonl="undef"
5662 $   d_socket="undef"
5663 $   d_socketpair = "undef"
5664 $   d_select="undef"
5665 $   netdb_hlen_type="int"
5666 $   netdb_host_type="char *"
5667 $   netdb_name_type="char *"
5668 $   netdb_net_type="long"
5669 $   d_gethbyaddr="undef"
5670 $   d_gethbyname="undef"
5671 $   d_getnbyaddr="undef"
5672 $   d_getnbyname="undef"
5673 $   d_getpbynumber="undef"
5674 $   d_getpbyname="undef"
5675 $   d_getsbyport="undef"
5676 $   d_getsbyname="undef"
5677 $   d_gethostprotos="undef"
5678 $   d_getnetprotos="undef"
5679 $   d_getprotoprotos="undef"
5680 $   d_getservprotos="undef"
5681 $   socksizetype="undef"
5682 $ ENDIF
5683 $! Threads
5684 $ d_oldpthreads="undef"
5685 $ IF use_threads
5686 $ THEN
5687 $   usethreads="define"
5688 $   d_pthreads_created_joinable="define"
5689 $ ELSE
5690 $   usethreads="undef"
5691 $   d_pthreads_created_joinable="undef"
5692 $ ENDIF
5693 $! 
5694 $! new (5.005_62++) typedefs for primitives
5695 $!
5696 $ echo "Choosing the C types to be used for Perl's internal types..."
5697 $ ivtype="long"
5698 $ uvtype="unsigned long"
5699 $ i8type="char"
5700 $ u8type="unsigned char"
5701 $ i16type="short"
5702 $ u16type="unsigned short"
5703 $ i32type="int"
5704 $ u32type="unsigned int"
5705 $ i64type="long long"
5706 $ u64type="unsigned long long"
5707 $ nvtype="double"
5708 $!
5709 $ IF use64bitint .OR. use64bitint .EQS. "define"
5710 $ THEN
5711 $   ivtype = "''i64type'"
5712 $   uvtype = "''u64type'"
5713 $ ENDIF
5714 $ i64size="8"
5715 $ u64size="8"
5716 $!
5717 $ doublemantbits = "52"
5718 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
5719 $ THEN
5720 $   nvtype="long double"
5721 $   nvmantbits = longdblmantbits
5722 $ ELSE
5723 $   nvmantbits = doublemantbits
5724 $ ENDIF
5725 $!
5726 $ tmp = "''ivtype'"
5727 $ GOSUB type_size_check
5728 $ ivsize = tmp
5729 $ IF ivtype .eqs. "long"
5730 $ THEN longsize = tmp
5731 $ ELSE
5732 $   tmp = "long"
5733 $   GOSUB type_size_check
5734 $   longsize = tmp
5735 $ ENDIF
5736 $!
5737 $ tmp = "''uvtype'"
5738 $ GOSUB type_size_check
5739 $ uvsize = tmp
5740 $!
5741 $ tmp = "''i8type'"
5742 $ GOSUB type_size_check
5743 $ i8size = tmp
5744 $!
5745 $ tmp = "''u8type'"
5746 $ GOSUB type_size_check
5747 $ u8size = tmp
5748 $!
5749 $ tmp = "''i16type'"
5750 $ GOSUB type_size_check
5751 $ i16size = tmp
5752 $ IF i16type .eqs. "short"
5753 $ THEN shortsize = tmp
5754 $ ELSE
5755 $   tmp = "short"
5756 $   gosub type_size_check
5757 $   shortsize = tmp
5758 $ ENDIF
5759 $!
5760 $ tmp = "''u16type'"
5761 $ GOSUB type_size_check
5762 $ u16size = tmp
5763 $!
5764 $ tmp = "''i32type'"
5765 $ GOSUB type_size_check
5766 $ i32size = tmp
5767 $ IF i32type .eqs. "int"
5768 $ THEN intsize = tmp
5769 $ ELSE
5770 $   tmp = "int"
5771 $   gosub type_size_check
5772 $   intsize = tmp
5773 $ ENDIF
5774 $!
5775 $ tmp = "''u32type'"
5776 $ gosub type_size_check
5777 $ u32size = tmp
5778 $!
5779 $ tmp = "''nvtype'"
5780 $ GOSUB type_size_check
5781 $ nvsize = tmp
5782 $!
5783 $ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
5784 $ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
5785 $ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
5786 $!
5787 $ d_nv_preserves_uv = "undef"
5788 $ echo4 "Checking how many bits of your UVs your NVs can preserve..."
5789 $ OS
5790 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5791 $ WS "#include <stdlib.h>"
5792 $ WS "#endif"
5793 $ WS "#include <stdio.h>"
5794 $ WS "int main() {"
5795 $ WS "    ''uvtype' u = 0;"
5796 $ WS "    int     n = 8 * ''uvsize';"
5797 $ WS "    int     i;"
5798 $ WS "    for (i = 0; i < n; i++) {"
5799 $ WS "      u = u << 1 | (''uvtype')1;"
5800 $ WS "      if ((''uvtype')(''nvtype')u != u)"
5801 $ WS "        break;"
5802 $ WS "    }"
5803 $ WS "    printf(""%d\n"", i);"
5804 $ WS "    exit(0);"
5805 $ WS "}"
5806 $ CS
5807 $ GOSUB compile
5808 $ nv_preserves_uv_bits = tmp
5809 $ IF F$INTEGER(nv_preserves_uv_bits) .GE. (F$INTEGER(uvsize) * 8)
5810 $ THEN
5811 $   d_nv_preserves_uv = "define"
5812 $   echo "Your NVs can preserve all ''nv_preserves_uv_bits' bits of your UVs."
5813 $ ELSE
5814 $   d_nv_preserves_uv = "undef"
5815 $   echo "Your NVs can preserve only ''nv_preserves_uv_bits' bits of your UVs." 
5816 $ ENDIF
5817 $!
5818 $ nv_overflows_integers_at = "0"
5819 $ echo4 "Checking to find the largest integer value your NVs can hold..."
5820 $ OS
5821 $ WS "#include <stdio.h>"
5822 $ WS ""
5823 $ WS "typedef ''nvtype' NV;"
5824 $ WS ""
5825 $ WS "int"
5826 $ WS "main() {"
5827 $ WS "  NV value = 2;"
5828 $ WS "  int count = 1;"
5829 $ WS ""
5830 $ WS "  while(count < 256) {"
5831 $ WS "    volatile NV up = value + 1.0;"
5832 $ WS "    volatile NV negated = -value;"
5833 $ WS "    volatile NV down = negated - 1.0;"
5834 $ WS "    volatile NV got_up = up - value;"
5835 $ WS "    int up_good = got_up == 1.0;"
5836 $ WS "    int got_down = down - negated;"
5837 $ WS "    int down_good = got_down == -1.0;"
5838 $ WS ""
5839 $ WS "    if (down_good != up_good) {"
5840 $ WS "      fprintf(stderr,"
5841 $ WS "              ""Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n"","
5842 $ WS "              up_good, (double) got_up, down_good, (double) got_down,"
5843 $ WS "              count, (double) value);"
5844 $ WS "      return 1;"
5845 $ WS "    }"
5846 $ WS "    if (!up_good) {"
5847 $ WS "      while (1) {"
5848 $ WS "        if (count > 8) {"
5849 $ WS "          count -= 8;"
5850 $ WS "          fputs(""256.0"", stdout);"
5851 $ WS "        } else {"
5852 $ WS "          count--;"
5853 $ WS "          fputs(""2.0"", stdout);"
5854 $ WS "        }"
5855 $ WS "        if (!count) {"
5856 $ WS "          puts("""");"
5857 $ WS "          return 0;"
5858 $ WS "        }"
5859 $ WS "        fputs(""*"", stdout);"
5860 $ WS "      }"
5861 $ WS "    }"
5862 $ WS "    value *= 2;"
5863 $ WS "    ++count;"
5864 $ WS "  }"
5865 $ WS "  fprintf(stderr, ""Cannot overflow integer range, even at 2**%d (%.20f)\n"","
5866 $ WS "          count, (double) value);"
5867 $ WS "  return 1;"
5868 $ WS "}"
5869 $ CS
5870 $ GOSUB compile
5871 $ IF F$LENGTH(tmp) .GT. 0
5872 $ THEN
5873 $   IF F$EXTRACT(0,1,tmp) .EQS. "2"
5874 $   THEN
5875 $     echo "The largest integer your NVs can preserve is equal to ''tmp'"
5876 $     nv_overflows_integers_at = tmp
5877 $   ELSE
5878 $     echo "Cannot determine the largest integer value your NVs can hold, unexpected output"
5879 $     echo "''tmp'"
5880 $   ENDIF
5881 $ ELSE
5882 $   echo "Cannot determine the largest integer value your NVs can hold"
5883 $ ENDIF
5884 $!
5885 $! Check for signbit (must already know nvtype)
5886 $!
5887 $ echo4 "Checking to see if you have signbit() available to work on ''nvtype'..."
5888 $ OS
5889 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5890 $ WS "#include <stdlib.h>"
5891 $ WS "#endif"
5892 $ WS "#include <fp.h>"
5893 $ WS "#include <stdio.h>"
5894 $ WS "int main()"
5895 $ WS "{"
5896 $ WS "    ''nvtype' x = 0.0;"
5897 $ WS "    ''nvtype' y = -0.0;"
5898 $ WS "    if ((signbit(x) == 0) && (signbit(y) != 0))"
5899 $ WS "        printf(""1\n"");"
5900 $ WS "    else"
5901 $ WS "        printf(""0\n"");"
5902 $ WS "}"
5903 $ CS
5904 $ GOSUB compile
5905 $ IF tmp .EQS. "1" 
5906 $ THEN 
5907 $     d_signbit = "define"
5908 $     echo4 "Yes."
5909 $ ELSE
5910 $     d_signbit = "undef"
5911 $     echo4 "Nope."
5912 $ ENDIF
5913 $!
5914 $ echo4 "Checking if kill() uses SYS$FORCEX, can't be called from a signal handler,"
5915 $ echo4 "or fails to handle a signal value of zero..."
5916 $ kill_by_sigprc = "undef"
5917 $ OS
5918 $ WS "#include <stdio.h>"
5919 $ WS "#include <signal.h>"
5920 $ WS "#include <unistd.h>"
5921 $ WS "void handler1(int s) { printf(""%d"",s); kill(getpid(),2); }"
5922 $ WS "void handler2(int s) { printf(""%d"",s); }"
5923 $ WS "main(){"
5924 $ WS "    printf(""0"");"
5925 $ WS "    signal(1,handler1);"
5926 $ WS "    signal(2,handler2);"
5927 $ WS "    kill(getpid(),1);"
5928 $ WS "    sleep(1);"
5929 $ WS "    kill(getpid(),0);"
5930 $ WS "    printf(""3\n"");"
5931 $ WS "}"
5932 $ CS
5933 $ ON ERROR THEN CONTINUE
5934 $ GOSUB compile
5935 $ IF tmp .NES. "0123"
5936 $ THEN 
5937 $   echo4 "Yes, it has at least one of those limitations."
5938 $   echo4 "Checking whether we can use SYS$SIGPRC instead..."
5939 $   OS
5940 $   WS "#include <stdio.h>"
5941 $   WS "#include <lib$routines.h>"
5942 $   WS "unsigned long code = 0;"
5943 $   WS "#define sys$sigprc SYS$SIGPRC"
5944 $   WS "#ifdef __cplusplus"
5945 $   WS "extern ""C"" {"
5946 $   WS "#endif"
5947 $   WS "    int sys$sigprc(unsigned int *,void *,unsigned int);"
5948 $   WS "#ifdef __cplusplus"
5949 $   WS "}"
5950 $   WS "#endif"
5951 $   WS "int handler(unsigned long *args) {"
5952 $   WS "    code = args[1];"
5953 $   WS "    return 1;"
5954 $   WS "}"
5955 $   WS "main() { "
5956 $   WS "    int iss;"
5957 $   WS "    lib$establish(handler);"
5958 $   WS "    iss = sys$sigprc(0,0,0x1234);"
5959 $   WS "    iss =  ((iss&1)==1 && code == 0x1234);" 
5960 $   WS "    printf(""%d\n"",iss);"
5961 $   WS "}"
5962 $   CS
5963 $   ON ERROR THEN CONTINUE
5964 $   GOSUB compile
5965 $   IF tmp .EQS. "1"
5966 $   THEN
5967 $       echo4 "Yep, we can."
5968 $       kill_by_sigprc = "define"
5969 $!
5970 $   ELSE
5971 $       echo4 "Nope, we can't."
5972 $   ENDIF
5973 $ ELSE
5974 $   echo4 "Nope, it doesn't."
5975 $ ENDIF
5976 $ DELETE/SYMBOL tmp
5977 $!
5978 $! Finally the composite ones. All config
5979 $!
5980 $ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
5981 $!
5982 $ IF ccname .EQS. "DEC"
5983 $ THEN
5984 $   ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5985 $ ENDIF
5986 $ IF ccname .EQS. "CXX"
5987 $ THEN
5988 $   ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
5989 $ ENDIF
5990 $ IF use_vmsdebug_perl
5991 $ THEN
5992 $   optimize="/List/Debug/NoOpt"
5993 $   ldflags="/Debug/Trace/Map"
5994 $   dbgprefix = "DBG"
5995 $ ELSE
5996 $   optimize= "/NoList"
5997 $   ldflags="/NoTrace/NoMap"
5998 $   dbgprefix = ""
5999 $ ENDIF
6000 $!
6001 $! Okay, we've got everything configured. Now go write out a config.sh.
6002 $ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
6003 $ echo4 "Creating ''basename_config_sh'..."
6004 $ open/write CONFIG 'config_sh'
6005 $ WC := write CONFIG
6006 $!
6007 $! ##BEGIN WRITE NEW CONSTANTS HERE##
6008 $!
6009 $ WC "#!/bin/sh"
6010 $ WC "#"
6011 $ WC "# This file was produced by Configure.COM on a ''osname' system."
6012 $ WC "#"
6013 $ WC "# Package name      : ''package'"
6014 $ WC "# Source directory  : ''src'"
6015 $ WC "# Configuration time: " + cf_time
6016 $ WC "# Configuration by  : " + cf_by
6017 $ WC "# Target system     : " + myuname
6018 $ WC ""
6019 $ WC "Makefile_SH='" + Makefile_SH + "'"
6020 $ WC "Mcc='" + Mcc + "'"
6021 $ WC "PERL_REVISION='" + revision + "'"
6022 $ WC "PERL_VERSION='" + patchlevel + "'" 
6023 $ WC "PERL_SUBVERSION='" + subversion + "'" 
6024 $ WC "PERL_API_REVISION='" + api_revision + "'"
6025 $ WC "PERL_API_VERSION='" + api_version + "'" 
6026 $ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
6027 $ WC "PERL_PATCHLEVEL='" + perl_patchlevel + "'"
6028 $ WC "perl_patchlevel='" + perl_patchlevel + "'"
6029 $ WC "PERL_CONFIG_SH='true'"
6030 $ WC "_a='" + lib_ext + "'"
6031 $ WC "_exe='" + exe_ext + "'"
6032 $ WC "_o='" + obj_ext + "'"
6033 $ WC "afs='undef'"
6034 $ WC "afsroot='/afs'"
6035 $ WC "alignbytes='" + alignbytes + "'"
6036 $ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
6037 $ WC "api_revision='" + api_revision + "'"
6038 $ WC "api_subversion='" + api_subversion + "'"
6039 $ WC "api_version='" + api_version + "'" 
6040 $ WC "api_versionstring='" + version + "'" 
6041 $ WC "ar='" + "'"
6042 $ WC "archlib='" + archlib + "'"
6043 $ WC "archlibexp='" + archlibexp + "'"
6044 $ WC "archname='" + archname + "'"
6045 $ WC "baserev='" + baserev + "'"
6046 $ WC "bin='" + bin + "'"
6047 $ WC "binexp='" + binexp + "'"
6048 $ WC "bootstrap_charset='undef'"
6049 $ WC "builddir='" + builddir + "'"
6050 $ WC "byteorder='1234'"
6051 $ WC "castflags='0'"
6052 $ WC "cc='" + perl_cc + "'"
6053 $ WC "cccdlflags='" + cccdlflags + "'"
6054 $ WC "ccdlflags='" + ccdlflags + "'"
6055 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
6056 $ THEN
6057 $    IF usestdstat .OR. usestdstat .EQS. "define"
6058 $    THEN
6059 $       ccdefines = "_USE_STD_STAT=1"
6060 $    ELSE
6061 $       ccdefines = "_LARGEFILE=1"
6062 $    ENDIF
6063 $ ELSE
6064 $     ccdefines = ""
6065 $ ENDIF
6066 $ IF ccdefines .NES. ""
6067 $ THEN
6068 $   WC "ccflags='" + ccflags + "/Define=" + ccdefines + "'"
6069 $ ELSE
6070 $   WC "ccflags='" + ccflags + "'"
6071 $ ENDIF
6072 $ WC "ccflags_uselargefiles='" + "'"
6073 $ WC "ccname='" + ccname + "'"
6074 $ WC "ccversion='" + ccversion + "'"
6075 $ WC "cf_by='" + cf_by + "'"
6076 $ WC "cf_email='" + cf_email + "'"
6077 $ WC "cf_time='" + cf_time + "'"
6078 $ WC "charbits='8'"
6079 $ WC "config_args='" + config_args + "'"
6080 $ WC "config_sh='" + config_sh + "'"
6081 $ WC "cpp_stuff='" + cpp_stuff + "'"
6082 $ WC "cpplast='" + cpplast + "'"
6083 $ WC "cppminus='" + cppminus + "'"
6084 $ WC "cpprun='" + cpprun + "'"
6085 $ WC "cppstdin='" + cppstdin + "'"
6086 $ IF use64bitint .OR. use64bitint .EQS. "define"
6087 $ THEN
6088 $!  gcvt() does not work for > 16 decimal places; fallback to sprintf
6089 $   WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
6090 $ ELSE
6091 $   WC "d_Gconvert='my_gconvert(x,n,t,b)'"
6092 $ ENDIF
6093 $ WC "d_PRIEUldbl='" + d_PRIEUldbl + "'"
6094 $ WC "d_PRIFUldbl='" + d_PRIFUldbl + "'"
6095 $ WC "d_PRIGUldbl='" + d_PRIGUldbl + "'"
6096 $ WC "d_PRIXU64='" + d_PRIXU64 + "'"
6097 $ WC "d_PRId64='" + d_PRId64 + "'"
6098 $ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
6099 $ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
6100 $ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
6101 $ WC "d_PRIi64='" + d_PRIi64 + "'"
6102 $ WC "d_PRIo64='" + d_PRIo64 + "'"
6103 $ WC "d_PRIu64='" + d_PRIu64 + "'"
6104 $ WC "d_PRIx64='" + d_PRIx64 + "'"
6105 $ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
6106 $ WC "d__fwalk='undef'"
6107 $ WC "d_accept4='undef'"
6108 $ WC "d_access='" + d_access + "'"
6109 $ WC "d_accessx='undef'"
6110 $ WC "d_acosh='" + d_acosh + "'"
6111 $ WC "d_aintl='undef'"
6112 $ WC "d_alarm='define'"
6113 $ WC "d_archlib='define'"
6114 $ WC "d_asctime64='undef'"
6115 $ WC "d_asinh='" + d_asinh + "'"
6116 $ WC "d_atanh='" + d_atanh + "'"
6117 $ WC "d_atolf='" + d_atolf + "'"
6118 $ WC "d_atoll='" + d_atoll + "'"
6119 $ WC "d_attribute_always_inline='undef'"
6120 $ WC "d_attribute_format='" + d_attribut + "'"
6121 $ WC "d_attribute_deprecated='undef'"
6122 $ WC "d_attribute_malloc='undef'"
6123 $ WC "d_attribute_nonnull='undef'"
6124 $ WC "d_attribute_noreturn='undef'"
6125 $ WC "d_attribute_pure='undef'"
6126 $ WC "d_attribute_unused='undef'"
6127 $ WC "d_attribute_visibility='undef'"
6128 $ WC "d_attribute_warn_unused_result='undef'"
6129 $ WC "d_prctl='undef'"
6130 $ WC "d_prctl_set_name='undef'"
6131 $ WC "d_printf_format_null='undef'"
6132 $ WC "d_bincompat3='undef'"
6133 $ WC "d_bsd='undef'"
6134 $ WC "d_bsdgetpgrp='undef'"
6135 $ WC "d_bsdsetpgrp='undef'"
6136 $ WC "d_builtin_choose_expr='undef'" ! GCC only
6137 $ WC "d_builtin_expect='undef'" ! GCC only
6138 $ WC "d_builtin_add_overflow='undef'" ! GCC only
6139 $ WC "d_builtin_mul_overflow='undef'" ! GCC only
6140 $ WC "d_builtin_sub_overflow='undef'" ! GCC only
6141 $ WC "d_casti32='define'"
6142 $ WC "d_castneg='define'"
6143 $ WC "d_cbrt='" + d_cbrt + "'"
6144 $ WC "d_chown='define'"
6145 $ WC "d_chroot='undef'"
6146 $ WC "d_chsize='undef'"
6147 $ WC "d_class='undef'"
6148 $ WC "d_closedir='define'"
6149 $ WC "d_cmsghdr_s='undef'"
6150 $ WC "d_copysign='" + d_copysign + "'"
6151 $ WC "d_copysignl='define'"
6152 $ WC "d_cplusplus='" + d_cplusplus + "'"
6153 $ WC "d_crypt='define'"
6154 $ WC "d_csh='undef'"
6155 $ WC "d_ctermid='define'"
6156 $ WC "d_ctime64='undef'"
6157 $ WC "d_cuserid='define'"
6158 $ WC "d_c99_variadic_macros='undef'"
6159 $ WC "d_dbl_dig='define'"
6160 $ WC "d_dbminitproto='undef'"
6161 $ WC "d_difftime='define'"
6162 $ WC "d_difftime64='undef'"
6163 $ WC "d_dir_dd_fd='undef'"
6164 $ WC "d_dirfd='undef'"
6165 $ WC "d_dirnamlen='define'"
6166 $ WC "d_dladdr='undef'"
6167 $ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."7.2")
6168 $ THEN
6169 $   WC "d_dlerror='define'"
6170 $   WC "d_dlopen='define'"
6171 $ ELSE
6172 $   WC "d_dlerror='undef'"
6173 $   WC "d_dlopen='undef'"
6174 $ ENDIF
6175 $ WC "d_dlsymun='undef'"
6176 $ WC "d_backtrace='undef'"
6177 $ WC "d_dosuid='undef'"
6178 $ WC "d_double_has_inf='" + d_double_has_inf + "'"
6179 $ WC "d_double_has_nan='" + d_double_has_nan + "'"
6180 $ WC "d_double_has_negative_zero='" + d_double_has_negative_zero + "'"
6181 $ WC "d_double_has_subnormals='" + d_double_has_subnormals + "'"
6182 $ WC "d_double_style_cray='undef'"
6183 $ WC "d_double_style_ibm='undef'"
6184 $ WC "d_double_style_ieee='" + d_double_style_ieee + "'"
6185 $ WC "d_double_style_vax='" + d_double_style_vax + "'"
6186 $ WC "d_drand48proto='" + d_drand48proto + "'"
6187 $ WC "d_dup2='define'"
6188 $ WC "d_dup3='undef'"
6189 $ WC "d_duplocale='undef'"
6190 $ WC "d_eaccess='undef'"
6191 $ WC "d_endgrent='define'"
6192 $ WC "d_endhent='" + d_endhent + "'"
6193 $ WC "d_endnent='" + d_endnent + "'"
6194 $ WC "d_endpent='" + d_endpent + "'"
6195 $ WC "d_endpwent='define'"
6196 $ WC "d_endsent='" + d_endsent + "'"
6197 $ WC "d_eofnblk='undef'"
6198 $ WC "d_erf='" + d_erf + "'"
6199 $ WC "d_erfc='" + d_erfc + "'"
6200 $ WC "d_eunice='undef'"
6201 $ WC "d_exp2='" + d_exp2 + "'"
6202 $ WC "d_expm1='" + d_expm1 + "'"
6203 $ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."8.3")
6204 $ THEN
6205 $   WC "d_fchmod='define'"
6206 $ ELSE
6207 $   WC "d_fchmod='undef'"
6208 $ ENDIF
6209 $ WC "d_fchdir='undef'"
6210 $ WC "d_fchown='define'"
6211 $ WC "d_fcntl='" + d_fcntl + "'"
6212 $ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
6213 $ WC "d_fd_set='" + d_fd_set + "'"
6214 $ WC "d_fd_macros='define'"
6215 $ WC "d_fdclose='undef'"
6216 $ WC "d_fdim='" + d_fdim + "'"
6217 $ WC "d_fds_bits='define'"
6218 $ WC "d_fegetround='undef'"
6219 $ WC "d_ffs='undef'"
6220 $ WC "d_ffsl='undef'"
6221 $ WC "d_fgetpos='define'"
6222 $ IF use_ieee_math
6223 $ THEN
6224 $   WC "d_finite='define'"
6225 $   WC "d_finitel='define'"
6226 $ ELSE
6227 $   WC "d_finite='undef'"
6228 $   WC "d_finitel='undef'"
6229 $ ENDIF
6230 $ WC "d_flexfnam='define'"
6231 $ WC "d_flock='undef'"
6232 $ WC "d_flockproto='undef'"
6233 $ WC "d_fma='" + d_fma + "'"
6234 $ WC "d_fmax='" + d_fmax + "'"
6235 $ WC "d_fmin='" + d_fmin + "'"
6236 $ WC "d_fork='undef'"
6237 $ WC "d_fp_class='undef'"
6238 $ WC "d_fp_classify='" + d_fp_classify + "'"
6239 $ WC "d_fp_classify='undef'"
6240 $ WC "d_fp_classl='undef'"
6241 $ WC "d_fpathconf='" + d_fpathconf + "'"
6242 $ WC "d_fpclass='undef'"
6243 $ WC "d_fpclassify='" + d_fpclassify + "'"
6244 $ WC "d_fpclassl='undef'"
6245 $ WC "d_fpgetround='undef'"
6246 $ WC "d_fpos64_t='" + d_fpos64_t + "'"
6247 $ WC "d_frexpl='" + d_frexpl + "'"
6248 $ WC "d_fs_data_s='undef'"
6249 $ WC "d_fseeko='" + d_fseeko + "'"
6250 $ WC "d_fsetpos='define'"
6251 $ WC "d_fstatfs='undef'"
6252 $ WC "d_fstatvfs='" + d_fstatvfs + "'"
6253 $ WC "d_fsync='define'"
6254 $ WC "d_ftello='" + d_ftello + "'"
6255 $ WC "d_ftime='define'"
6256 $ WC "d_futimes='undef'"
6257 $ WC "d_gdbmndbm_h_uses_prototypes='undef'"
6258 $ WC "d_gdbm_ndbm_h_uses_prototypes='undef'"
6259 $ WC "d_getaddrinfo='define'"
6260 $ WC "d_getcwd='define'"
6261 $ WC "d_getespwnam='undef'"
6262 $ WC "d_getfsstat='undef'"
6263 $ WC "d_getgrent='define'"
6264 $ WC "d_getgrps='undef'"
6265 $ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
6266 $ WC "d_gethbyname='" + d_gethbyname + "'"
6267 $ WC "d_gethent='" + d_gethent + "'"
6268 $ WC "d_gethname='" + d_gethname + "'"
6269 $ WC "d_gethostprotos='" + d_gethostprotos + "'"
6270 $ WC "d_getitimer='" + d_getitimer + "'"
6271 $ WC "d_getlogin='define'"
6272 $ WC "d_getmnt='undef'"
6273 $ WC "d_getmntent='undef'"
6274 $ WC "d_getnameinfo='define'"
6275 $ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
6276 $ WC "d_getnbyname='" + d_getnbyname + "'"
6277 $ WC "d_getnent='" + d_getnent + "'"
6278 $ WC "d_getnetprotos='" + d_getnetprotos + "'"
6279 $ WC "d_getpagsz='undef'"
6280 $ WC "d_getpbyname='" + d_getpbyname + "'"
6281 $ WC "d_getpbynumber='" + d_getpbynumber + "'"
6282 $ WC "d_getpent='" + d_getpent + "'"
6283 $ WC "d_getpgid='" + d_getpgid + "'"
6284 $ WC "d_getpgrp2='undef'"
6285 $ WC "d_getpgrp='" + d_getpgrp + "'"
6286 $ WC "d_getppid='" + d_getppid + "'"
6287 $ WC "d_getprior='undef'"
6288 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
6289 $ WC "d_getprpwnam='undef'"
6290 $ WC "d_getpwent='define'"
6291 $ WC "d_getsbyname='" + d_getsbyname + "'"
6292 $ WC "d_getsbyport='" + d_getsbyport + "'"
6293 $ WC "d_getsent='" + d_getsent + "'"
6294 $ WC "d_getservprotos='" + d_getservprotos + "'"
6295 $ WC "d_getspnam='undef'"
6296 $ WC "d_gettimeod='" + d_gettimeod + "'"
6297 $ WC "d_gmtime64='undef'"
6298 $ WC "d_gnulibc='undef'"
6299 $ WC "d_grpasswd='undef'"
6300 $ WC "d_hasmntopt='undef'"
6301 $ WC "d_htonl='" + d_htonl + "'"
6302 $ WC "d_hypot='" + d_hypot + "'"
6303 $ WC "d_ilogb='" + d_ilogb + "'"
6304 $ WC "d_ilogbl='undef'"
6305 $ WC "d_inc_version_list='undef'"
6306 $ WC "d_index='" + d_index + "'"
6307 $ WC "d_inetaton='define'"
6308 $ WC "d_inetntop='define'"
6309 $ WC "d_inetpton='define'"
6310 $ WC "d_int64_t='" + d_int64_t + "'"
6311 $ WC "d_ip_mreq='define'"
6312 $ WC "d_ip_mreq_source='undef'"
6313 $ WC "d_ipv6_mreq='define'"
6314 $ WC "d_ipv6_mreq_source='undef'"
6315 $ WC "d_isascii='define'"
6316 $ WC "d_isblank='" + d_isblank + "'"
6317 $ WC "d_isfinite='undef'"
6318 $ WC "d_isfinitel='undef'"
6319 $ WC "d_isinf='undef'"
6320 $ WC "d_isinfl='undef'"
6321 $ WC "d_isless='" + d_isless + "'"
6322 $ WC "d_isnan='" + d_isnan + "'"
6323 $ WC "d_isnanl='" + d_isnanl + "'"
6324 $ WC "d_isnormal='" + d_isnormal + "'"
6325 $ WC "d_j0='" + d_j0 + "'"
6326 $ WC "d_j0l='undef'"
6327 $ WC "d_killpg='define'"
6328 $ WC "d_lchown='" + d_lchown + "'"
6329 $ WC "d_ldbl_dig='define'"
6330 $ WC "d_ldexpl='" + d_ldexpl + "'"
6331 $ WC "d_lgamma='" + d_lgamma + "'"
6332 $ WC "d_libm_lib_version='undef'"
6333 $ WC "d_link='" + d_link + "'"
6334 $ WC "d_llrint='" + d_llrint + "'"
6335 $ WC "d_llrintl='" + d_llrintl + "'"
6336 $ WC "d_llround='" + d_llround + "'"
6337 $ WC "d_llroundl='" + d_llroundl + "'"
6338 $ WC "d_llseek='undef'"
6339 $ WC "d_localeconv_l='undef'"
6340 $ WC "d_localtime64='undef'"
6341 $ WC "d_locconv='" + d_locconv + "'"
6342 $ WC "d_lc_monetary_2008='undef'"
6343 $ WC "d_lockf='undef'"
6344 $ WC "d_log1p='" + d_log1p + "'"
6345 $ WC "d_log2='" + d_log2 + "'"
6346 $ WC "d_logb='" + d_logb + "'"
6347 $ WC "d_long_double_style_ieee='" + d_long_double_style_ieee + "'"
6348 $ WC "d_long_double_style_ieee_doubledouble='undef'"
6349 $ WC "d_long_double_style_ieee_extended='" + d_long_double_style_ieee_extended + "'"
6350 $ WC "d_long_double_style_ieee_std='" + d_long_double_style_ieee_std + "'"
6351 $ WC "d_long_double_style_vax='" + d_long_double_style_vax + "'"
6352 $ WC "d_longdbl='" + d_longdbl + "'"
6353 $ WC "d_longlong='" + d_longlong + "'"
6354 $ WC "d_lrint='" + d_lrint + "'"
6355 $ WC "d_lrintl='" + d_lrintl + "'"
6356 $ WC "d_lround='" + d_lround + "'"
6357 $ WC "d_lroundl='" + d_lroundl + "'"
6358 $ WC "d_lseekproto='define'"
6359 $ WC "d_lstat='" + d_lstat + "'"
6360 $ WC "d_madvise='undef'"
6361 $ WC "d_malloc_size='undef'"
6362 $ WC "d_malloc_good_size='undef'"
6363 $ WC "d_mblen='" + d_mblen + "'"
6364 $ WC "d_mbrlen='define'"
6365 $ WC "d_mbrtowc='define'"
6366 $ WC "d_mbstowcs='" + d_mbstowcs + "'"
6367 $ WC "d_mbtowc='" + d_mbtowc + "'"
6368 $ WC "d_memmem='undef'"
6369 $ WC "d_memrchr='" + d_memrchr + "'"
6370 $ WC "d_mkdir='define'"
6371 $ WC "d_mkdtemp='" + d_mkdtemp + "'"
6372 $ WC "d_mkfifo='undef'"
6373 $ WC "d_mknod='undef'"
6374 $ WC "d_mkostemp='undef'"
6375 $ WC "d_mkstemp='" + d_mkstemp + "'"
6376 $ WC "d_mkstemps='" + d_mkstemps + "'"
6377 $ WC "d_mktime='" + d_mktime + "'"
6378 $ WC "d_mktime64='undef'"
6379 $ WC "d_mmap='" + d_mmap + "'"
6380 $ WC "d_modfl='" + d_modfl + "'"
6381 $ WC "d_modflproto='" + d_modflproto + "'"
6382 $ WC "d_modfl_pow32_bug='undef'"
6383 $ WC "d_mprotect='" + d_mprotect + "'"
6384 $ WC "d_msg='undef'"
6385 $ WC "d_msgctl='undef'"
6386 $ WC "d_msgget='undef'"
6387 $ WC "d_msgrcv='undef'"
6388 $ WC "d_msgsnd='undef'"
6389 $ WC "d_msg_ctrunc='undef'"
6390 $ WC "d_msg_dontroute='undef'"
6391 $ WC "d_msg_oob='undef'"
6392 $ WC "d_msg_peek='undef'"
6393 $ WC "d_msg_proxy='undef'"
6394 $ WC "d_msghdr_s='undef'"
6395 $ WC "d_msync='" + d_msync + "'"
6396 $ WC "d_munmap='" + d_munmap + "'"
6397 $ WC "d_mymalloc='" + d_mymalloc + "'"
6398 $ WC "d_nan='undef'"
6399 $ WC "d_nanosleep='" + d_nanosleep + "'"
6400 $ WC "d_ndbm='undef'"
6401 $ WC "d_ndbm_h_uses_prototypes='undef'"
6402 $ WC "d_nearbyint='" + d_nearbyint + "'"
6403 $ WC "d_nextafter='" + d_nextafter + "'"
6404 $ WC "d_nexttoward='" + d_nexttoward + "'"
6405 $ WC "d_nice='define'"
6406 $ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
6407 $ WC "d_nl_langinfo_l='undef'"
6408 $ WC "d_non_int_bitfields='define'"
6409 $ WC "d_getenv_preserves_other_thread='" + d_getenv_preserves_other_thread + "'"
6410 $ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
6411 $ WC "nv_overflows_integers_at='" + nv_overflows_integers_at + "'"
6412 $ WC "nv_preserves_uv_bits='" + nv_preserves_uv_bits + "'"
6413 $ WC "d_nv_zero_is_allbits_zero='define'"
6414 $ WC "d_off64_t='" + d_off64_t + "'"
6415 $ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
6416 $ WC "d_oldarchlib='define'"
6417 $ WC "d_oldpthreads='" + d_oldpthreads + "'"
6418 $ WC "d_oldsock='undef'"
6419 $ WC "d_open3='define'"
6420 $ WC "d_openat='undef'"
6421 $ WC "d_unlinkat='undef'"
6422 $ WC "d_renameat='undef'"
6423 $ WC "d_linkat='undef'"
6424 $ WC "d_fchmodat='undef'"
6425 $ WC "d_pathconf='" + d_pathconf + "'"
6426 $ WC "d_pause='define'"
6427 $ WC "d_perl_otherlibdirs='undef'"
6428 $ WC "d_phostname='" + d_phostname + "'"
6429 $ WC "d_pipe='define'"
6430 $ WC "d_pipe2='undef'"
6431 $ WC "d_poll='" + d_poll + "'"
6432 $ WC "d_portable='define'"
6433 $ WC "d_procselfexe='undef'"
6434 $ WC "d_pseudofork='undef'"
6435 $ WC "d_pthread_atfork='undef'"
6436 $ WC "d_pthread_attr_setscope='" + d_pthread_attr_setscope + "'"
6437 $ WC "d_pthread_yield='" + d_pthread_yield + "'"
6438 $ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
6439 $ WC "d_ptrdiff_t='define'"
6440 $ WC "d_pwage='undef'"
6441 $ WC "d_pwchange='undef'"
6442 $ WC "d_pwclass='undef'"
6443 $ WC "d_pwcomment='define'"
6444 $ WC "d_pwexpire='undef'"
6445 $ WC "d_pwgecos='define'"
6446 $ WC "d_pwpasswd='define'"
6447 $ WC "d_pwquota='undef'"
6448 $ WC "d_qgcvt='undef'"
6449 $ WC "d_quad='" + d_quad + "'"
6450 $ WC "d_re_comp='undef'"
6451 $ WC "d_readdir='define'"
6452 $ WC "d_readlink='" + d_readlink + "'"
6453 $ WC "d_readv='define'"
6454 $ WC "d_realpath='" + d_realpath + "'"
6455 $ WC "d_recvmsg='define'"
6456 $ WC "d_regcmp='undef'"
6457 $ WC "d_regcomp='undef'"
6458 $ WC "d_remainder='" + d_remainder + "'"
6459 $ WC "d_remquo='" + d_remquo + "'"
6460 $ WC "d_rename='define'"
6461 $ WC "d_rewinddir='define'"
6462 $ WC "d_rint='" + d_rint + "'"
6463 $ WC "d_rmdir='define'"
6464 $ WC "d_round='" + d_round + "'"
6465 $ WC "d_sbrkproto='define'"
6466 $ WC "d_scalbn='" + d_scalbn + "'"
6467 $ WC "d_scalbnl='" + d_scalbnl + "'"
6468 $ WC "d_sched_yield='" + d_sched_yield + "'"
6469 $ WC "d_scm_rights='undef'"
6470 $ WC "d_seekdir='define'"
6471 $ WC "d_select='" + d_select + "'"
6472 $ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."8.4")
6473 $ THEN
6474 $   WC "d_sem='define'"
6475 $   WC "d_semctl='define'"
6476 $   WC "d_semctl_semid_ds='define'"
6477 $   WC "d_semctl_semun='define'"
6478 $   WC "d_semget='define'"
6479 $   WC "d_semop='define'"
6480 $ ELSE
6481 $   WC "d_sem='undef'"
6482 $   WC "d_semctl='undef'"
6483 $   WC "d_semctl_semid_ds='undef'"
6484 $   WC "d_semctl_semun='undef'"
6485 $   WC "d_semget='undef'"
6486 $   WC "d_semop='undef'"
6487 $ ENDIF
6488 $ WC "d_sendmsg='define'"
6489 $ WC "d_setegid='undef'"
6490 $ WC "d_setenv='" + d_setenv + "'"
6491 $ WC "d_seteuid='" + d_seteuid + "'"
6492 $ WC "d_setgrent='" + d_setgrent + "'"
6493 $ WC "d_setgrps='undef'"
6494 $ WC "d_sethent='" + d_sethent + "'"
6495 $ WC "d_setitimer='" + d_setitimer + "'"
6496 $ WC "d_setlinebuf='undef'"
6497 $ WC "d_setlocale='" + d_setlocale + "'"
6498 $ WC "d_setlocale_accepts_any_locale_name='" + d_setlocale_accepts_any_locale_name + "'"
6499 $ WC "d_setnent='" + d_setnent + "'"
6500 $ WC "d_setpent='" + d_setpent + "'"
6501 $ WC "d_setpgid='" + d_setpgid + "'"
6502 $ WC "d_setpgrp2='undef'"
6503 $ WC "d_setpgrp='" + d_setpgrp + "'"
6504 $ WC "d_setprior='undef'"
6505 $ WC "d_setproctitle='" + d_setproctitle + "'"
6506 $ WC "d_setpwent='define'"
6507 $ WC "d_setregid='" + d_setregid + "'"
6508 $ WC "d_setresgid='undef'"
6509 $ WC "d_setresuid='undef'"
6510 $ WC "d_setreuid='" + d_setreuid + "'"
6511 $ WC "d_setrgid='undef'"
6512 $ WC "d_setruid='undef'"
6513 $ WC "d_setsent='" + d_setsent + "'"
6514 $ WC "d_setsid='" + d_setsid + "'"
6515 $ WC "d_setvbuf='" + d_setvbuf + "'"
6516 $ WC "d_shm='" + d_shm + "'"
6517 $ WC "d_shmat='" + d_shmat + "'"
6518 $ WC "d_shmatprototype='" + d_shmatprototype + "'"
6519 $ WC "d_shmctl='" + d_shmctl + "'"
6520 $ WC "d_shmdt='" + d_shmdt + "'"
6521 $ WC "d_shmget='" + d_shmget + "'"
6522 $ WC "d_sigaction='" + d_sigaction + "'"
6523 $ WC "d_siginfo_si_addr='" + d_siginfo_si_addr + "'"
6524 $ WC "d_siginfo_si_band='" + d_siginfo_si_band + "'"
6525 $ WC "d_siginfo_si_errno='" + d_siginfo_si_errno + "'"
6526 $ WC "d_siginfo_si_fd='" + d_siginfo_si_fd + "'"
6527 $ WC "d_siginfo_si_pid='" + d_siginfo_si_pid + "'"
6528 $ WC "d_siginfo_si_status='" + d_siginfo_si_status + "'"
6529 $ WC "d_siginfo_si_uid='" + d_siginfo_si_uid + "'"
6530 $ WC "d_siginfo_si_value='" + d_siginfo_si_value + "'"
6531 $ WC "d_signbit='" + d_signbit + "'"
6532 $ WC "d_sigprocmask='" + d_sigprocmask + "'"
6533 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
6534 $ WC "d_sin6_scope_id='" + d_sin6_scope_id + "'"
6535 $ WC "d_sitearch='define'"
6536 $ WC "d_sockaddr_in6='define'"
6537 $ WC "d_sockaddr_sa_len='" + d_sockaddr_sa_len + "'"
6538 $ WC "d_sockaddr_storage='undef'"
6539 $ WC "d_sockatmark='undef'"
6540 $ WC "d_sockatmarkproto='undef'"
6541 $ WC "d_socket='" + d_socket + "'"
6542 $ WC "d_socklen_t='" + d_socklen_t + "'"
6543 $ WC "d_sockpair='" + d_sockpair + "'"
6544 $ WC "d_socks5_init='undef'"
6545 $ WC "d_sqrtl='define'"
6546 $ WC "d_sresgproto='undef'"
6547 $ WC "d_sresgproto='undef'"
6548 $ WC "d_sresproto='undef'"
6549 $ WC "d_sresuproto='undef'"
6550 $ WC "d_stat='define'"
6551 $ WC "d_statblks='undef'"
6552 $ WC "d_statfs_f_flags='undef'"
6553 $ WC "d_statfs_s='undef'"
6554 $ WC "d_statfsflags='undef'"
6555 $ WC "d_static_inline='define'"
6556 $ WC "d_thread_local='undef'" ! see perl_thread_local
6557 $ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
6558 $ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
6559 $ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'"
6560 $ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'"
6561 $ WC "d_stdio_stream_array='undef'"
6562 $ WC "d_stdiobase='" + d_stdiobase + "'"
6563 $ WC "d_stdstdio='" + d_stdstdio + "'"
6564 $ WC "d_faststdio='" + d_faststdio + "'"
6565 $ WC "d_statvfs='" + d_statvfs + "'"
6566 $ WC "d_strcoll='" + d_strcoll + "'"
6567 $ WC "d_strftime='define'"
6568 $ WC "d_strlcat='undef'"
6569 $ WC "d_strlcpy='undef'"
6570 $ WC "d_strnlen='" + d_strnlen + "'"
6571 $ WC "d_strtod='define'"
6572 $ WC "d_strtod_l='undef'"
6573 $ WC "d_strtol='define'"
6574 $ WC "d_strtold='" + d_strtold + "'"
6575 $ WC "d_strtold_l='undef'"
6576 $ WC "d_strtoll='" + d_strtoll + "'"
6577 $ WC "d_strtoq='" + d_strtoq + "'"
6578 $ WC "d_strtoul='define'"
6579 $ WC "d_strtoull='" + d_strtoull + "'"
6580 $ WC "d_strtouq='" + d_strtouq + "'"
6581 $ WC "d_strxfrm='" + d_strxfrm  + "'"
6582 $ WC "d_strxfrm_l='" + d_strxfrm_l  + "'"
6583 $ WC "d_suidsafe='undef'"
6584 $ WC "d_symlink='" + d_symlink + "'"
6585 $ WC "d_syscall='undef'"
6586 $ WC "d_syscallproto='undef'"
6587 $ WC "d_sysconf='" + d_sysconf + "'"
6588 $ WC "d_sysernlst='undef'"
6589 $ WC "d_syserrlst='undef'"
6590 $ WC "d_system='define'"
6591 $ WC "d_tcgetpgrp='undef'"
6592 $ WC "d_tcsetpgrp='undef'"
6593 $ WC "d_telldir='define'"
6594 $ WC "d_telldirproto='define'"
6595 $ WC "d_tgamma='" + d_tgamma + "'"
6596 $ WC "d_thread_safe_nl_langinfo_l='undef'"
6597 $ WC "d_time='define'"
6598 $ WC "d_timegm='undef'"
6599 $ WC "d_times='define'"
6600 $ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."7.0")
6601 $ THEN
6602 $   WC "d_tm_tm_gmtoff='define'"
6603 $   WC "d_tm_tm_zone='define'"
6604 $ ELSE
6605 $   WC "d_tm_tm_gmtoff='undef'"
6606 $   WC "d_tm_tm_zone='undef'"
6607 $ ENDIF
6608 $ WC "d_truncate='" + d_truncate + "'"
6609 $ WC "d_trunc='" + d_trunc + "'"
6610 $ WC "d_truncl='" + d_truncl + "'"
6611 $ WC "d_tzname='" + d_tzname + "'"
6612 $ WC "d_u32align='define'"
6613 $ WC "d_ualarm='" + d_ualarm + "'"
6614 $ WC "d_umask='define'"
6615 $ WC "d_uname='" + d_uname + "'"
6616 $ WC "d_union_semun='undef'"
6617 $ WC "d_unlink_all_versions='" + d_unlink_all_versions + "'"    ! VMS-specific
6618 $ WC "d_unordered='undef'"
6619 $ WC "d_unsetenv='" + d_unsetenv + "'"
6620 $ WC "d_clearenv='" + d_clearenv + "'"
6621 $ WC "d_usleep='" + d_usleep + "'"
6622 $ WC "d_usleepproto='" + d_usleep + "'"
6623 $ WC "d_ustat='undef'"
6624 $ WC "d_vendorarch='undef'"
6625 $ WC "d_vendorbin='undef'"
6626 $ WC "d_vendorlib='undef'"
6627 $ WC "d_vendorscript='undef'"
6628 $ WC "d_vfork='define'"
6629 $ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
6630 $ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
6631 $ WC "d_vms_shorten_long_symbols='" + d_vms_shorten_long_symbols + "'" ! VMS
6632 $ WC "d_void_closedir='define'"
6633 $ WC "d_voidsig='undef'"
6634 $ WC "d_voidtty='" + "'"
6635 $ WC "d_vsnprintf='" + d_vsnprintf + "'"
6636 $ WC "d_wait4='" + d_wait4 + "'"
6637 $ WC "d_waitpid='define'"
6638 $ WC "d_wcrtomb='define'"
6639 $ WC "d_wcscmp='define'"
6640 $ WC "d_wcstombs='define'"
6641 $ WC "d_wcsxfrm='define'"
6642 $ WC "d_wctomb='define'"
6643 $ WC "d_writev='define'"
6644 $ WC "d_xenix='undef'"
6645 $ WC "db_hashtype=' '"
6646 $ WC "db_prefixtype=' '"
6647 $ WC "db_version_major='" + "'"
6648 $ WC "db_version_minor='" + "'"
6649 $ WC "db_version_patch='" + "'"
6650 $ WC "dbgprefix='" + dbgprefix + "'"
6651 $ WC "devtype='" + devtype + "'"
6652 $ WC "default_inc_excludes_dot='" + default_inc_excludes_dot + "'"
6653 $ WC "direntrytype='struct dirent'"
6654 $ WC "dlext='" + dlext + "'"
6655 $ WC "dlobj='" + dlobj + "'"
6656 $ WC "dlsrc='dl_vms.xs'"
6657 $ WC "doublekind='3'"
6658 $ WC "doubleinfbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf0, 0x7f'"
6659 $ WC "doublenanbytes='0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xf8, 0x7f'"
6660 $ WC "doublemantbits='" + doublemantbits + "'"
6661 $ WC "doublesize='" + doublesize + "'"
6662 $ WC "drand01='" + drand01 + "'"
6663 $ WC "dtrace='" + "'"
6664 $!
6665 $! The dynamic_ext symbol may be quite long
6666 $!
6667 $ tmp = "dynamic_ext='" + dynamic_ext + "'"
6668 $ WC/symbol tmp
6669 $ DELETE/SYMBOL tmp
6670 $ WC "eagain=' '"
6671 $ WC "ebcdic='undef'"
6672 $ WC "embedmymalloc='" + usemymalloc + "'"
6673 $ WC "eunicefix=':'"
6674 $ WC "exe_ext='" + exe_ext + "'"
6675 $!
6676 $! The extensions symbols may be quite long
6677 $!
6678 $ WC/symbol "extensions='", nonxs_ext, " ", nonxs_ext2, " ", dynamic_ext, "'"
6679 $ WC "fflushNULL='define'"
6680 $ WC "fflushall='undef'"
6681 $ WC "fpostype='fpos_t'"
6682 $ WC "freetype='void'"
6683 $ WC "full_ar='" + "'"
6684 $ WC "full_csh='" + " '"
6685 $ WC "full_sed='_NLA0:'"
6686 $ WC "gccversion='" + gccversion + "'"
6687 $ WC "gidformat='lu'"
6688 $ WC "gidsign='1'"
6689 $ WC "gidsize='4'"
6690 $ WC "gidtype='" + gidtype + "'"
6691 $ WC "groupstype='Gid_t'"
6692 $ WC "h_fcntl='false'"
6693 $ WC "h_sysfile='false'"
6694 $ WC "hint='none'"
6695 $ WC "hintfile='" + "'"
6696 $ WC "i16size='" + i16size + "'"
6697 $ WC "i16type='" + i16type + "'"
6698 $ WC "i32size='" + i32size + "'"
6699 $ WC "i32type='" + i32type + "'"
6700 $ WC "i64size='" + i64size + "'"
6701 $ WC "i64type='" + i64type + "'"
6702 $ WC "i8size='" + i8size + "'"
6703 $ WC "i8type='" + i8type + "'"
6704 $ WC "i_arpainet='" + i_arpainet + "'"
6705 $ WC "i_bfd='undef'"
6706 $ WC "i_bsdioctl='undef'"
6707 $ WC "i_crypt='undef'"
6708 $ WC "i_db='undef'"
6709 $ WC "i_dbm='undef'"
6710 $ WC "i_dirent='undef'" ! we roll our own
6711 $ WC "i_dlfcn='undef'"
6712 $ WC "i_execinfo='undef'"
6713 $ WC "i_fcntl='" + i_fcntl + "'"
6714 $ WC "i_fenv='undef'"
6715 $ WC "i_fp='undef'"
6716 $ WC "i_fp_class='undef'"
6717 $ WC "i_gdbm='undef'"
6718 $ WC "i_gdbm_ndbm='undef'"
6719 $ WC "i_gdbmndbm='undef'"
6720 $ WC "i_grp='" + i_grp + "'"
6721 $ WC "i_ieeefp='undef'"
6722 $ WC "i_inttypes='" + i_inttypes + "'"
6723 $ WC "i_langinfo='" + i_langinfo + "'"
6724 $ WC "i_libutil='" + i_libutil + "'"
6725 $ WC "i_locale='" + i_locale + "'"
6726 $ WC "i_machcthr='undef'"
6727 $ WC "i_machcthreads='undef'"
6728 $ WC "i_malloc='undef'"
6729 $ WC "i_mallocmalloc='undef'"
6730 $ WC "i_mntent='undef'"
6731 $ WC "i_ndbm='undef'"
6732 $ WC "i_netdb='" + i_netdb + "'"
6733 $ WC "i_neterrno='define'"
6734 $ WC "i_netinettcp='" + i_netinettcp + "'"
6735 $ WC "i_niin='" + i_niin + "'"
6736 $ WC "i_poll='" + i_poll + "'"
6737 $ WC "i_prot='undef'"
6738 $ WC "i_pthread='define'"
6739 $ WC "i_pwd='undef'"
6740 $ WC "i_quadmath='undef'"
6741 $ WC "i_rpcsvcdbm='undef'"
6742 $ WC "i_sgtty='undef'"
6743 $ WC "i_shadow='" + i_shadow + "'"
6744 $ WC "i_socks='" + i_socks + "'"
6745 $ IF ccname .EQS. "DEC" .AND. F$INTEGER(Dec_C_Version).GE.60400000
6746 $ THEN
6747 $   WC "i_stdbool='define'"
6748 $ ELSE
6749 $   WC "i_stdbool='undef'"
6750 $ ENDIF
6751 $ WC "i_stdint='" + i_stdint + "'"
6752 $ WC "i_stdlib='define'"
6753 $ WC "i_sunmath='undef'"
6754 $ WC "i_sysaccess='" + i_sysaccess + "'"
6755 $ WC "i_sysdir='undef'"
6756 $ WC "i_sysfile='" + i_sysfile + "'"
6757 $ WC "i_sysfilio='undef'"
6758 $ WC "i_sysin='undef'"
6759 $ WC "i_sysioctl='" + i_sysioctl + "'"
6760 $ WC "i_syslog='" + i_syslog + "'"
6761 $ WC "i_sysmman='undef'"
6762 $ WC "i_sysmode='" + i_sysmode + "'"
6763 $ WC "i_sysmount='undef'"
6764 $ WC "i_sysndir='undef'"
6765 $ WC "i_sysparam='undef'"
6766 $ WC "i_syspoll='" + i_syspoll + "'"
6767 $ WC "i_sysresrc='undef'"
6768 $ WC "i_syssecrt='" + i_syssecrt + "'"
6769 $ WC "i_sysselct='undef'"
6770 $ WC "i_syssockio='undef'"
6771 $ WC "i_sysstat='define'"
6772 $ WC "i_sysstatfs='undef'"
6773 $ WC "i_sysstatvfs='" + i_sysstatvfs + "'"
6774 $ WC "i_systime='undef'"
6775 $ WC "i_systimek='undef'"
6776 $ WC "i_systimes='undef'"
6777 $ WC "i_systypes='define'"
6778 $ WC "i_sysuio='" + i_sysuio + "'"
6779 $ WC "i_sysun='" + i_sysun + "'"
6780 $ WC "i_sysutsname='" + i_sysutsname + "'"
6781 $ WC "i_sysvfs='undef'"
6782 $ WC "i_syswait='undef'"
6783 $ WC "i_termio='undef'"
6784 $ WC "i_termios='undef'"
6785 $ WC "i_time='define'"
6786 $ WC "i_unistd='" + i_unistd + "'"
6787 $ WC "i_ustat='undef'"
6788 $ WC "i_utime='" + i_utime + "'"
6789 $ WC "i_vfork='undef'"
6790 $ WC "i_wchar='define'"
6791 $ WC "i_wctype='define'"
6792 $ WC "i_xlocale='undef'"
6793 $ WC "xlocale_needed='undef'"
6794 $ WC "inc_version_list='0'"
6795 $ WC "inc_version_list_init='0'"
6796 $ WC "installarchlib='" + installarchlib + "'"
6797 $ WC "installbin='" + installbin + "'"
6798 $ WC "installman1dir='" + installman1dir + "'"
6799 $ WC "installman3dir='" + installman3dir + "'"
6800 $ WC "installprefix='" + vms_prefix + "'"
6801 $ WC "installprefixexp='/" + vms_prefix + "'"
6802 $ WC "installprivlib='" + installprivlib + "'"
6803 $ WC "installscript='" + installscript + "'"
6804 $ WC "installsitearch='" + installsitearch + "'"
6805 $ WC "installsitebin='" + sitebin + "'"
6806 $ WC "installsitelib='" + installsitelib + "'"
6807 $ WC "installusrbinperl='undef'"
6808 $ WC "intsize='" + intsize + "'"
6809 $ WC "ivdformat='" + ivdformat + "'"
6810 $ WC "ivsize='" + ivsize + "'"
6811 $ WC "ivtype='" + ivtype + "'"
6812 $!
6813 $! The xs_extensions symbol may be quite long
6814 $!
6815 $ WC/symbol "known_extensions='", xs_extensions, " ", nonxs_ext, " ", nonxs_ext2, "'"
6816 $ WC "ld='" + ld + "'"
6817 $ WC "ld_can_script='undef'"
6818 $ WC "lddlflags='/Share'"
6819 $ WC "ldflags='" + ldflags + "'"
6820 $ WC "ldflags_uselargefiles='" + "'"
6821 $ WC "ldlibpthname='" + "'"
6822 $ WC "lib_ext='" + lib_ext + "'"
6823 $ WC "libc='" + libc + "'"
6824 $ WC "libpth='/sys$share /sys$library'"
6825 $ WC "libs='" + libs + "'"
6826 $ WC "libswanted='" + "'"
6827 $ WC "libswanted_uselargefiles='" + "'"
6828 $ WC "longdblsize='" + longdblsize + "'"
6829 $ WC "longdblkind='" + longdblkind + "'"
6830 $ WC "longdblinfbytes='" + longdblinfbytes + "'"
6831 $ WC "longdblnanbytes='" + longdblnanbytes + "'"
6832 $ WC "longdblmantbits='" + longdblmantbits + "'"
6833 $ WC "longlongsize='" + longlongsize + "'"
6834 $ WC "longsize='" + longsize + "'"
6835 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
6836 $ THEN
6837 $   WC "lseeksize='8'"
6838 $   WC "lseektype='off_t'"
6839 $ ELSE
6840 $   WC "lseeksize='4'"
6841 $   WC "lseektype='int'"
6842 $ ENDIF
6843 $ WC "mab='" + "'"
6844 $ WC "mad='undef'"
6845 $ WC "make='" + make + "'"
6846 $ WC "malloctype='void *'"
6847 $ WC "usemallocwrap='" + usemallocwrap + "'"
6848 $ WC "man1ext='rno'"
6849 $ WC "man3ext='rno'"
6850 $ WC "mmaptype='void *'"
6851 $ WC "modetype='unsigned int'"
6852 $ WC "multiarch='undef'"
6853 $ WC "mydomain='" + mydomain + "'"
6854 $ WC "myhostname='" + myhostname + "'"
6855 $ WC "myuname='" + myuname + "'"
6856 $ WC "need_va_copy='undef'"
6857 $ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
6858 $ WC "netdb_host_type='" + netdb_host_type + "'"
6859 $ WC "netdb_name_type='" + netdb_name_type + "'"
6860 $ WC "netdb_net_type='" + netdb_net_type + "'"
6861 $ WC/symbol "nonxs_ext='", nonxs_ext, " ", nonxs_ext2, "'"
6862 $ WC "nveformat='" + nveformat + "'"
6863 $ WC "nvEUformat='" + nvEUformat + "'"
6864 $ WC "nvfformat='" + nvfformat + "'"
6865 $ WC "nvFUformat='" + nvFUformat + "'"
6866 $ WC "nvgformat='" + nvgformat + "'"
6867 $ WC "nvGUformat='" + nvGUformat + "'"
6868 $ WC "nvmantbits='" + nvmantbits + "'"
6869 $ WC "nvsize='" + nvsize + "'"
6870 $ WC "nvtype='" + nvtype + "'"
6871 $ WC "o_nonblock=' '"
6872 $ WC "obj_ext='" + obj_ext + "'"
6873 $ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
6874 $ WC "oldarchlib='" + oldarchlib + "'"
6875 $ WC "oldarchlibexp='" + oldarchlibexp + "'"
6876 $ WC "optimize='" + optimize + "'"
6877 $ WC "osname='" + osname + "'"
6878 $ WC "osvers='" + osvers + "'"
6879 $ WC "otherlibdirs='" + "'"
6880 $ WC "package='" + package + "'"
6881 $ WC "pager='" + pager + "'"
6882 $ WC "patchlevel='" + patchlevel + "'"
6883 $ WC "path_sep='|'"
6884 $ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
6885 $ WC "perladmin='" + perladmin + "'"
6886 $ WC "perllibs='" + perllibs + "'"
6887 $ WC "perlpath='" + "''vms_prefix':[000000]Perl''exe_ext'" + "'"
6888 $ WC "perl_static_inline='static inline'"
6889 $ WC "perl_symbol='" + perl_symbol + "'"  ! VMS specific
6890 $ WC "perl_thread_local=''" ! FIXME - as this is ia64 ABI, it may well be supported
6891 $ WC "perl_verb='" + perl_verb + "'"      ! VMS specific
6892 $ WC "pgflquota='" + pgflquota + "'"
6893 $ WC "pidtype='" + pidtype + "'"
6894 $ WC "prefix='" + vms_prefix + "'"
6895 $ WC "prefixexp='/" + vms_prefix + "'"
6896 $ WC "privlib='" + privlib + "'"
6897 $ WC "privlibexp='" + privlibexp + "'"
6898 $ WC "procselfexe=' '"
6899 $ WC "prototype='define'"
6900 $ WC "ptrsize='" + ptrsize + "'"
6901 $ WC "quadkind='" + quadkind + "'"
6902 $ WC "quadtype='" + quadtype + "'" 
6903 $ WC "randbits='" + randbits + "'"
6904 $ WC "randfunc='" + randfunc + "'"
6905 $ WC "randseedtype='" + randseedtype + "'"
6906 $ WC "ranlib='" + "'"
6907 $ WC "rd_nodata=' '"
6908 $ WC "revision='" + revision + "'"
6909 $ WC "sGMTIME_max='4294967295'"
6910 $ WC "sGMTIME_min='0'"
6911 $ WC "sLOCALTIME_max='4294967295'"
6912 $ WC "sLOCALTIME_min='0'"
6913 $ WC "sPRId64='" + sPRId64 + "'"
6914 $ WC "sPRIEUldbl='" + sPRIEUldbl + "'"
6915 $ WC "sPRIFUldbl='" + sPRIFUldbl + "'"
6916 $ WC "sPRIGUldbl='" + sPRIGUldbl + "'"
6917 $ WC "sPRIXU64='" + sPRIXU64 + "'"
6918 $ WC "sPRIeldbl='" + sPRIeldbl + "'"
6919 $ WC "sPRIfldbl='" + sPRIfldbl + "'"
6920 $ WC "sPRIgldbl='" + sPRIgldbl + "'"
6921 $ WC "sPRIi64='" + sPRIi64 + "'"
6922 $ WC "sPRIo64='" + sPRIo64 + "'"
6923 $ WC "sPRIu64='" + sPRIu64 + "'"
6924 $ WC "sPRIx64='" + sPRIx64 + "'"
6925 $ WC "sSCNfldbl='" + sSCNfldbl + "'"
6926 $ WC "sched_yield='" + sched_yield + "'"
6927 $ WC "scriptdir='" + scriptdir + "'"
6928 $ WC "scriptdirexp='" + scriptdir + "'"  ! use scriptdir for now
6929 $ WC "seedfunc='" + seedfunc + "'"
6930 $ WC "selectminbits='32'"
6931 $ WC "selecttype='" + selecttype + "'"
6932 $ WC "sh='MCR'"
6933 $ WC "sharpbang='#!'"
6934 $ WC "shmattype='" + shmattype + "'"
6935 $ WC "shortsize='" + shortsize + "'"
6936 $ IF (f$length(sig_name) .GE. 244)
6937 $ THEN
6938 $     tmp = "sig_name='" + sig_name + "'"
6939 $     WC/symbol tmp
6940 $     DELETE/SYMBOL tmp
6941 $ ELSE
6942 $     WC "sig_name='" + sig_name + "'"
6943 $ ENDIF
6944 $ IF (f$length(sig_name_init) .GE. 244)
6945 $ THEN
6946 $     tmp = "sig_name_init='" + sig_name_init + "'"
6947 $     WC/symbol tmp
6948 $     DELETE/SYMBOL tmp
6949 $ ELSE
6950 $     WC "sig_name_init='" + sig_name_init + "'"
6951 $ ENDIF
6952 $ WC "sig_num='" + sig_num + "'"
6953 $ WC "sig_num_init='" + sig_num_init + "'"
6954 $ WC "sig_count='" + sig_count + "'"
6955 $ WC "sig_size='" + sig_size + "'"
6956 $ WC "signal_t='" + signal_t + "'"
6957 $ WC "sitearch='" + sitearch + "'"
6958 $ WC "sitearchexp='" + sitearchexp + "'"
6959 $ WC "sitebin='" + sitebin + "'"
6960 $ WC "sitebinexp='" + sitebin + "'"
6961 $ WC "sitelib='" + sitelib + "'"
6962 $ WC "sitelib_stem='" + sitelib_stem + "'"
6963 $ WC "sitelibexp='" + sitelibexp + "'"
6964 $ WC "siteprefix='" + vms_prefix + "'"
6965 $ WC "siteprefixexp='/" + vms_prefix + "'"
6966 $ WC "sizesize='" + sizesize + "'"
6967 $ WC "sizetype='size_t'"
6968 $ WC "so='" + so + "'"
6969 $ WC "socksizetype='" + socksizetype + "'"
6970 $ WC "spitshell='write sys$output '"
6971 $ WC "src='" + src + "'"
6972 $ WC "ssizetype='int'"
6973 $ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
6974 $ WC "static_ext='" + static_ext + "'"
6975 $ WC "st_dev_size='"4"'"
6976 $ WC "st_dev_sign='1'"
6977 $ WC "st_ino_size='" + st_ino_size + "'"
6978 $ WC "st_ino_sign='1'"
6979 $ WC "stdchar='" + stdchar + "'"
6980 $ WC "stdio_base='((*fp)->_base)'"
6981 $ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
6982 $ WC "stdio_cnt='((*fp)->_cnt)'"
6983 $ WC "stdio_ptr='((*fp)->_ptr)'"
6984 $ WC "stdio_stream_array=' " + "'"
6985 $ WC "subversion='" + subversion + "'"
6986 $ WC "targetarch='" + "'"
6987 $ WC "targetsh='MCR'"
6988 $ WC "timetype='" + timetype + "'"
6989 $ WC "u16size='" + u16size + "'"
6990 $ WC "u16type='" + u16type + "'"
6991 $ WC "u32size='" + u32size + "'"
6992 $ WC "u32type='" + u32type + "'"
6993 $ WC "u64size='" + u64size + "'"
6994 $ WC "u64type='" + u64type + "'"
6995 $ WC "u8size='" + u8size + "'"
6996 $ WC "u8type='" + u8type + "'"
6997 $ WC "uidformat='lu'"
6998 $ WC "uidsign='1'"
6999 $ WC "uidsize='4'"
7000 $ WC "uidtype='" + uidtype + "'"
7001 $ WC "uquadtype='" + uquadtype + "'" 
7002 $ WC "use64bitall='" + use64bitall + "'"
7003 $ WC "use64bitint='" + use64bitint + "'"
7004 $ WC "usecasesensitive='" + be_case_sensitive + "'"    ! VMS-specific
7005 $ WC "usedebugging_perl='"+use_debugging_perl+"'"
7006 $ WC "usedefaultstrict='undef'"
7007 $ WC "usedefaulttypes='" + usedefaulttypes + "'"    ! VMS-specific
7008 $ WC "usecbacktrace='undef'"
7009 $ WC "usecrosscompile='undef'"
7010 $ WC "usedevel='" + usedevel + "'"
7011 $ WC "usedl='" + usedl + "'"
7012 $ WC "usedtrace='undef'"
7013 $ WC "usefaststdio='" + usefaststdio + "'"
7014 $ WC "useieee='" + useieee + "'"                    ! VMS-specific
7015 $ WC "useithreads='" + useithreads + "'"
7016 $ WC "usekernelthreads='" + usekernelthreads + "'"      ! VMS-specific
7017 $ WC "usekernprocpathname='undef'"
7018 $ WC "usensgetexecutablepath='undef'"
7019 $ WC "uselargefiles='" + uselargefiles + "'"
7020 $ WC "uselongdouble='" + uselongdouble + "'"
7021 $ WC "usemorebits='" + usemorebits + "'"
7022 $ WC "usemultiplicity='" + usemultiplicity + "'"
7023 $ WC "usemymalloc='" + usemymalloc + "'"
7024 $ WC "useperlio='define'"
7025 $ WC "useposix='false'"
7026 $ WC "usequadmath='undef'"
7027 $ WC "usereentrant='undef'"
7028 $ WC "userelocatableinc='undef'"
7029 $ WC "usesecurelog='" + usesecurelog + "'"  ! VMS-specific
7030 $ WC "useshortenedsymbols='" + useshortenedsymbols + "'"    ! VMS-specific
7031 $ WC "useshrplib='true'"
7032 $ WC "usesitecustomize='" + usesitecustomize + "'"
7033 $ WC "usesocks='undef'"
7034 $ WC "usethreads='" + usethreads + "'"
7035 $ WC "usethreadupcalls='" + usethreadupcalls + "'"      ! VMS-specific
7036 $ WC "usevendorprefix='" + "'" ! try to say no, though we'll be ignored as of MM 5.90_01
7037 $ WC "useversionedarchname='" + useversionedarchname + "'"
7038 $ WC "usevfork='true'"
7039 $ WC "usevmsdebug='" + usevmsdebug + "'"     ! VMS-specific
7040 $ WC "uvoformat='" + uvoformat + "'"
7041 $ WC "uvsize='" + uvsize + "'"
7042 $ WC "uvtype='" + uvtype + "'"
7043 $ WC "uvuformat='" + uvuformat + "'"
7044 $ WC "uvxformat='" + uvxformat + "'"
7045 $ WC "uvXUformat='" + uvXUformat + "'"
7046 $ WC "vendorarch='" + "'"
7047 $ WC "vendorarchexp='" + "'"
7048 $ WC "vendorbin='" + "'"
7049 $ WC "vendorbinexp='" + "'"
7050 $ WC "vendorlib_stem='" + "'"
7051 $ WC "vendorlib='" + "'"
7052 $ WC "vendorlibexp='" + "'"
7053 $ WC "vendorprefix='" + "'"
7054 $ WC "vendorprefixexp='" + "'"
7055 $ WC "version='" + version + "'"
7056 $ WC "version_patchlevel_string='" + version_patchlevel_string + "'"
7057 $ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
7058 $ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
7059 $ WC "vms_ver='" + vms_ver + "'" ! VMS specific
7060 $!
7061 $! ## The UNIXy POSIXy reentrantey thingys ##
7062 $! See "Appendix B, Version-Dependency Tables" in the C RTL
7063 $! manual for when assorted _r functions became available.
7064 $!
7065 $ IF use_threads
7066 $ THEN
7067 $   WC "asctime_r_proto='REENTRANT_PROTO_B_SB'"
7068 $   WC "d_asctime_r='define'"
7069 $   WC "ctime_r_proto='REENTRANT_PROTO_B_SB'"
7070 $   WC "d_ctime_r='define'"
7071 $ ELSE
7072 $   WC "asctime_r_proto='0'"
7073 $   WC "d_asctime_r='undef'"
7074 $   WC "ctime_r_proto='0'"
7075 $   WC "d_ctime_r='undef'"
7076 $ ENDIF
7077 $ WC "d_crypt_r='undef'"
7078 $ WC "d_ctermid_r='undef'"
7079 $ WC "d_drand48_r='undef'"
7080 $ WC "d_endgrent_r='undef'"
7081 $ WC "d_endhostent_r='undef'"
7082 $ WC "d_endnetent_r='undef'"
7083 $ WC "d_endprotoent_r='undef'"
7084 $ WC "d_endpwent_r='undef'"
7085 $ WC "d_endservent_r='undef'"
7086 $ WC "d_freelocale='undef'"
7087 $ WC "d_gai_strerror='define'"
7088 $ WC "d_getgrent_r='undef'"
7089 $ WC "d_getgrgid_r='" + d_getgrgid_r + "'"
7090 $ WC "d_getgrnam_r='" + d_getgrnam_r + "'"
7091 $ WC "d_gethostbyaddr_r='undef'"
7092 $ WC "d_gethostbyname_r='undef'"
7093 $ WC "d_gethostent_r='undef'"
7094 $ WC "d_getlogin_r='define'"
7095 $ WC "d_getnetbyaddr_r='undef'"
7096 $ WC "d_getnetbyname_r='undef'"
7097 $ WC "d_getnetent_r='undef'"
7098 $ WC "d_getprotobyname_r='undef'"
7099 $ WC "d_getprotobynumber_r='undef'"
7100 $ WC "d_getprotoent_r='undef'"
7101 $ WC "d_getpwent_r='undef'"
7102 $ WC "d_getpwnam_r='" + d_getpwnam_r + "'"
7103 $ WC "d_getpwuid_r='" + d_getpwuid_r + "'"
7104 $ WC "d_getservbyname_r='undef'"
7105 $ WC "d_getservbyport_r='undef'"
7106 $ WC "d_getservent_r='undef'"
7107 $ WC "d_getspnam_r='undef'"
7108 $ WC "d_gmtime_r='undef'"      ! leave undef'd; we use my_gmtime
7109 $ WC "d_lgamma_r='undef'"
7110 $ WC "d_localtime_r='undef'"   ! leave undef'd; we use my_localtime
7111 $ WC "d_localtime_r_needs_tzset='undef'"
7112 $ WC "d_newlocale='undef'"
7113 $ WC "d_querylocale='undef'"
7114 $ WC "d_random_r='undef'"
7115 $ WC "d_readdir_r='define'"     ! always defined; we roll our own
7116 $ WC "d_readdir64_r='undef'"
7117 $ WC "d_setgrent_r='undef'"
7118 $ WC "d_sethostent_r='undef'"
7119 $ WC "d_setlocale_r='undef'"
7120 $ WC "d_setnetent_r='undef'"
7121 $ WC "d_setprotoent_r='undef'"
7122 $ WC "d_setpwent_r='undef'"
7123 $ WC "d_setservent_r='undef'"
7124 $ WC "d_snprintf='" + d_snprintf + "'"
7125 $ WC "d_srand48_r='undef'"
7126 $ WC "d_srandom_r='undef'"
7127 $ WC "d_strerror_l='undef'"
7128 $ WC "d_strerror_r='undef'"
7129 $ WC "d_tmpnam_r='undef'"
7130 $ WC "d_towlower='define'"
7131 $ WC "d_towupper='define'"
7132 $ WC "d_ttyname_r='" + d_ttyname_r + "'"
7133 $ WC "d_uselocale='undef'"
7134 $ WC "ctermid_r_proto='0'"
7135 $ WC "crypt_r_proto='0'"
7136 $ WC "drand48_r_proto='0'"
7137 $ WC "endgrent_r_proto='0'"
7138 $ WC "endhostent_r_proto='0'"
7139 $ WC "endnetent_r_proto='0'"
7140 $ WC "endprotoent_r_proto='0'"
7141 $ WC "endpwent_r_proto='0'"
7142 $ WC "endservent_r_proto='0'"
7143 $ WC "getgrent_r_proto='0'"
7144 $ WC "getgrgid_r_proto='" + getgrgid_r_proto + "'"
7145 $ WC "getgrnam_r_proto='" + getgrnam_r_proto + "'"
7146 $ WC "gethostbyaddr_r_proto='0'"
7147 $ WC "gethostbyname_r_proto='0'"
7148 $ WC "gethostent_r_proto='0'"
7149 $ IF use_threads
7150 $ THEN
7151 $   WC "getlogin_r_proto='REENTRANT_PROTO_I_BW'"
7152 $ ELSE
7153 $   WC "getlogin_r_proto='0'"
7154 $ ENDIF
7155 $ WC "getnetbyaddr_r_proto='0'"
7156 $ WC "getnetbyname_r_proto='0'"
7157 $ WC "getnetent_r_proto='0'"
7158 $ WC "getprotobyname_r_proto='0'"
7159 $ WC "getprotobynumber_r_proto='0'"
7160 $ WC "getprotoent_r_proto='0'"
7161 $ WC "getpwent_r_proto='0'"
7162 $ WC "getpwnam_r_proto='0'"
7163 $ WC "getpwuid_r_proto='0'"
7164 $ WC "getservbyname_r_proto='0'"
7165 $ WC "getservbyport_r_proto='0'"
7166 $ WC "getservent_r_proto='0'"
7167 $ WC "getspnam_r_proto='0'"
7168 $ WC "gmtime_r_proto='0'"
7169 $ WC "localtime_r_proto='0'"
7170 $ WC "random_r_proto='0'"
7171 $ WC "readdir_r_proto='REENTRANT_PROTO_I_TSR'"  ! always defined; we roll our own
7172 $ WC "readdir64_r_proto='0'"
7173 $ WC "setgrent_r_proto='0'"
7174 $ WC "sethostent_r_proto='0'"
7175 $ WC "setlocale_r_proto='0'"
7176 $ WC "setnetent_r_proto='0'"
7177 $ WC "setprotoent_r_proto='0'"
7178 $ WC "setpwent_r_proto='0'"
7179 $ WC "setservent_r_proto='0'"
7180 $ WC "srand48_r_proto='0'"
7181 $ WC "srandom_r_proto='0'"
7182 $ WC "strerror_r_proto='0'"
7183 $ WC "tmpnam_r_proto='0'"
7184 $ WC "ttyname_r_proto='" + ttyname_r_proto + "'"
7185 $!
7186 $! ##END WRITE NEW CONSTANTS HERE##
7187 $!
7188 $ CLOSE CONFIG
7189 $!
7190 $! Okay, we've gotten here. Build munchconfig.exe
7191 $ COPY/NOLOG [-.vms]munchconfig.c []
7192 $ COPY/NOLOG [-.vms]'Makefile_SH' []
7193 $ 'Perl_CC' 'ccflags' munchconfig.c
7194 $ IF Needs_Opt
7195 $ THEN
7196 $   OPEN/WRITE CONFIG []munchconfig.opt
7197 $   IF ccname .EQS. "GCC"
7198 $   THEN
7199 $     WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
7200 $   ENDIF
7201 $   WRITE CONFIG "Sys$Share:VAXCRTL/Share"
7202 $   CLOSE CONFIG
7203 $   'ld'/EXE='exe_ext' munchconfig'obj_ext',munchconfig.opt/opt
7204 $   DELETE/NOLOG/NOCONFIRM munchconfig.opt;
7205 $ ELSE
7206 $   'ld'/EXE='exe_ext' munchconfig'obj_ext'
7207 $ ENDIF
7208 $ IF F$SEARCH("munchconfig''obj_ext'") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig'obj_ext';
7209 $ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
7210 $ IF ccname .EQS. "CXX"
7211 $ THEN
7212 $   CALL Cxx_demangler_cleanup
7213 $ ENDIF
7214 $!
7215 $ IF alldone .EQS. ""
7216 $ THEN
7217 $   cat4 SYS$INPUT:
7218 $   DECK
7219
7220 If you'd like to make any changes to the config.sh file before I begin
7221 to configure things, answer yes to the following question.
7222
7223 $   EOD
7224 $   bool_dflt="n"
7225 $   rp="Do you wish to edit ''basename_config_sh'? [''bool_dflt'] "
7226 $   GOSUB myread
7227 $   IF ans
7228 $   THEN
7229 $     echo4 ""
7230 $     echo4 "Be sure to type LOGOUT after you have edited the file,"
7231 $     echo4 "then this procedure will resume."
7232 $     echo4 ""
7233 $     default = F$ENVIRONMENT("DEFAULT")
7234 $     DIRECTORY 'config_sh'
7235 $     SET DEFAULT [-]
7236 $     SPAWN/WAIT
7237 $     SET DEFAULT 'default'
7238 $   ENDIF
7239 $ ENDIF
7240 $!
7241 $ echo ""
7242 $ echo4 "Adding ''osname' specific preprocessor commands."
7243 $ !
7244 $ ! we need an fdl file
7245 $ CREATE [-]CONFIG.FDL
7246 $ DECK
7247 RECORD
7248   FORMAT STREAM_LF
7249 $ EOD
7250 $ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
7251 $ ! First spit out the header info with the local defines (to get
7252 $ ! around the 255 character command line limit)
7253 $ OPEN/APPEND CONFIG [-]config.local
7254 $ IF use_debugging_perl THEN WC "#define DEBUGGING"
7255 $ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
7256 $ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
7257 $ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
7258 $ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
7259 $ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
7260 $ IF (Has_Dec_C_Sockets)
7261 $ THEN
7262 $    WC "#define VMS_DO_SOCKETS"
7263 $    WC "#define DECCRTL_SOCKETS"
7264 $ ENDIF
7265 $! This is VMS-specific for now
7266 $ WC "#''d_setenv' HAS_SETENV"
7267 $ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
7268 $ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
7269 $ IF use64bitint .OR. use64bitint .EQS. "define"
7270 $ THEN
7271 $   WC "#define USE_64_BIT_INT"
7272 $ ENDIF
7273 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
7274 $ THEN
7275 $   WC "#define USE_LONG_DOUBLE"
7276 $ ENDIF
7277 $ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
7278     WC "#define USE_64_BIT_ALL"
7279 $ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
7280 $ IF shorten_long_symbols THEN WC "#define VMS_SHORTEN_LONG_SYMBOLS"
7281 $ IF use_ieee_math THEN WC "#define USE_IEEE"
7282 $ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
7283 $ WC "#define HAS_ENVGETENV"
7284 $ WC "#define PERL_EXTERNAL_GLOB"
7285 $ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
7286 $ IF unlink_all_versions .OR. unlink_all_versions .EQS. "define" THEN -
7287     WC "#define UNLINK_ALL_VERSIONS"
7288 $ IF d_sockaddr_sa_len .EQS. "define" then WC "#define _SOCKADDR_LEN 1"
7289 $ IF ccname .EQS. "CXX" then WC "#define NO_ENVIRON_ARRAY"
7290 $ IF ccname .EQS. "CXX" then WC "#define VMS" ! only has __VMS by default
7291 $ WC "#define _PTHREAD_EXC_INCL_CLEAN" ! avoid conflict between DECthreads TRY/CATCH and Perl TRY/CATCH
7292 $ CLOSE CONFIG
7293 $!
7294 $ echo4 "Doing variable substitutions on .SH files..."
7295 $ echo4 "Extracting config.h (with variable substitutions)"
7296 $!
7297 $! Now build the normal config.h
7298 $ DEFINE/USER_MODE sys$output [-]config.main
7299 $ mcr []munchconfig'exe_ext' 'config_sh' [-]config_h.sh
7300 $ ! Concatenate them together
7301 $ copy [-]config.local,[-]config.main [-]config.h
7302 $! Clean up
7303 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.MAIN;*
7304 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.LOCAL;*
7305 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;*
7306 $!
7307 $ IF ccname .EQS. "DEC"
7308 $ THEN
7309 $   DECC_REPLACE = "DECC=decc=1"
7310 $ ELSE
7311 $   DECC_REPLACE = "DECC="
7312 $ ENDIF
7313 $ IF ccname .EQS. "CXX"
7314 $ THEN
7315 $   DECCXX_REPLACE = "DECCXX=DECCXX=1"
7316 $ ELSE
7317 $   DECCXX_REPLACE = "DECCXX="
7318 $ ENDIF
7319 $ IF ccname .EQS. "GCC"
7320 $ THEN
7321 $   GNUC_REPLACE = "GNUC=gnuc=1"
7322 $ ELSE
7323 $   GNUC_REPLACE = "GNUC=" 
7324 $ ENDIF
7325 $ IF Has_Dec_C_Sockets
7326 $ THEN
7327 $   SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
7328 $ ELSE
7329 $   SOCKET_REPLACE = "SOCKET="
7330 $ ENDIF
7331 $ IF use_threads
7332 $ THEN
7333 $   THREAD_REPLACE = "THREAD=THREADED=1"
7334 $ ELSE
7335 $   THREAD_REPLACE = "THREAD="
7336 $ ENDIF
7337 $ IF mymalloc
7338 $ THEN
7339 $   MALLOC_REPLACE = "MALLOC=MALLOC=1"
7340 $ ELSE
7341 $   MALLOC_REPLACE = "MALLOC="
7342 $ ENDIF
7343 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
7344 $ THEN
7345 $   IF usestdstat .or. usestdstat .eqs. "define"
7346 $   THEN
7347 $      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_USE_STD_STAT=1"
7348 $   ELSE
7349 $      LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_LARGEFILE=1"
7350 $   ENDIF
7351 $ ELSE
7352 $   LARGEFILE_REPLACE = "LARGEFILE="
7353 $ ENDIF
7354 $ IF use_vmsdebug_perl
7355 $ THEN
7356 $   DEBUG_REPLACE = "USEVMSDEBUG=__DEBUG__=1"
7357 $ ELSE
7358 $   DEBUG_REPLACE = "USEVMSDEBUG="
7359 $ ENDIF
7360 $ PREFIX_REPLACE = "PREFIX=PREFIX=''prefix'"
7361 $!
7362 $! In order not to stress the tiny command buffer on pre-7.3-2 systems,
7363 $! we put the following substitutions in a file and pass the file to
7364 $! munchconfig.
7365 $!
7366 $ open/write CONFIG extra_subs.txt
7367 $ WC := write CONFIG
7368 $ WC "''DECC_REPLACE'"
7369 $ WC "''DECCXX_REPLACE'"
7370 $ WC "''ARCH_TYPE'"
7371 $ WC "''GNUC_REPLACE'"
7372 $ WC "''SOCKET_REPLACE'"
7373 $ WC "''THREAD_REPLACE'"
7374 $ WC "''C_Compiler_Replace'"
7375 $ WC "''MALLOC_REPLACE'"
7376 $ WC "''THREAD_UPCALLS'"
7377 $ WC "''THREAD_KERNEL'"
7378 $ WC "PV=''version'"
7379 $ WC "FLAGS=FLAGS=''extra_flags'"
7380 $ WC "''LARGEFILE_REPLACE'"
7381 $ WC "ARCHNAME=ARCHNAME=''archname'"
7382 $ WC "''DEBUG_REPLACE'"
7383 $ WC "''PREFIX_REPLACE'"
7384 $ close CONFIG
7385 $!
7386 $ echo4 "Extracting ''defmakefile' (with variable substitutions)"
7387 $ DEFINE/USER_MODE sys$output 'UUmakefile'
7388 $ mcr []munchconfig'exe_ext' 'config_sh' 'Makefile_SH' -f extra_subs.txt
7389 $! Clean up after ourselves
7390 $ DELETE/NOLOG/NOCONFIRM []munchconfig'exe_ext';
7391 $ DELETE/NOLOG/NOCONFIRM []extra_subs.txt;
7392 $!
7393 $! Note that the /key qualifier to search, as in:
7394 $! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
7395 $! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
7396 $!
7397 $ echo4 "Extracting extra_pods.com (without variable substitutions)"
7398 $ Create Sys$Disk:[-]extra_pods.com
7399 $ Deck/Dollar="$EOExtra_Pods$"
7400 $!++ extra_pods.com
7401 $!   NOTE: This file is extracted as part of the VMS configuration process.
7402 $!   Any changes made to it directly will be lost.  If you need to make any
7403 $!   changes, please edit the template in Configure.Com instead.
7404 $!   Use FORCE if you've just podified a README.* file on VMS.
7405 $ miniperl = f$search("sys$disk:[]miniperl.%xe;") ! could have alternate extension
7406 $ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
7407     search README.* "=head"/window=0/output=extra.pods
7408 $ open/read/error=extra_close EXTRA extra.pods
7409 $extra_loop:
7410 $ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
7411 $ file_type = f$edit(f$parse(file,,,"TYPE",),"LOWERCASE") - "."
7412 $ if file_type .nes. "VMS" .and. file_type .nes. "vms"
7413 $ then
7414 $   pod_file = "[.pod]perl''file_type'.pod"
7415 $   file = file - "''f$parse(file,,,"VERSION",)'"
7416 $   if p1 .eqs. "CLEAN"
7417 $   then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
7418 $   else
7419 $     do_copy := false
7420 $     if f$search(pod_file) .eqs. ""
7421 $     then do_copy := true
7422 $     else
7423 $       file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
7424 $       pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
7425 $       if file_rdt .GTS. pod_file_rdt then do_copy := true
7426 $     endif
7427 $     ! wacky method to preserve case on ODS-5 even when parse style is traditional
7428 $     if do_copy then mcr 'miniperl' -e "exit 0+$^E unless File::Copy::rmscopy(q{''file'}, q{''pod_file'});"
7429 $   endif
7430 $ endif
7431 $ goto extra_loop
7432 $extra_close:
7433 $ close EXTRA
7434 $ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
7435     purge/nolog extra.pods
7436 $!-- extra_pods.com
7437 $EOExtra_Pods$
7438 $!
7439 $!  Warn of dangerous symbols or logical names
7440 $!
7441 $Bad_environment: SUBROUTINE
7442 $   Bad_env = ""
7443 $   IF p2 .eqs. "SYMBOL"
7444 $   THEN
7445 $     IF f$type('p1') .nes. "" THEN  Bad_env := SYMBOL
7446 $   ELSE
7447 $     IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
7448 $   ENDIF
7449 $   IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
7450 $   THEN
7451 $     IF f$search("config.msg") .nes. ""
7452 $     THEN
7453 $       OPEN/APPEND CONFIG config.msg
7454 $     ELSE
7455 $       OPEN/WRITE CONFIG config.msg
7456 $     ENDIF
7457 $     IF Bad_env .eqs. "SYMBOL"
7458 $     THEN
7459 $       WRITE CONFIG ""
7460 $       WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
7461 $       WRITE CONFIG " delete before building ''package' via:"
7462 $       WRITE CONFIG "     $ DELETE/SYMBOL/GLOBAL ''p1'"
7463 $       IF f$locate("""",&p1) .ge. f$length(&p1)
7464 $       THEN
7465 $       WRITE CONFIG " after building, testing, and installing ''package'"
7466 $       WRITE CONFIG " restore the symbol with:"
7467 $       WRITE CONFIG "     $ ''p1' == """ + &p1 + """"
7468 $       ENDIF
7469 $     ENDIF
7470 $     IF Bad_env .eqs. "LOGICAL"
7471 $     THEN
7472 $       WRITE CONFIG ""
7473 $       WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
7474 $       WRITE CONFIG " deassign before building ''package'"
7475 $     ENDIF
7476 $     CLOSE CONFIG
7477 $     Bad_env = ""
7478 $   ENDIF
7479 $ EXIT
7480 $ ENDSUBROUTINE ! Bad_environment
7481 $ echo ""
7482 $ echo4 "Checking for dangerous pre-existing global symbols and logical names."
7483 $ CALL Bad_environment "COMP"
7484 $ CALL Bad_environment "EXT"
7485 $ CALL Bad_environment "FOO"
7486 $ CALL Bad_environment "LIB"
7487 $ CALL Bad_environment "LIST"
7488 $ CALL Bad_environment "MIME"
7489 $ CALL Bad_environment "POSIX"
7490 $ CALL Bad_environment "SYS"
7491 $ CALL Bad_environment "T"
7492 $ CALL Bad_environment "THREAD"
7493 $ CALL Bad_environment "THREADS"
7494 $ CALL Bad_environment "TIME"
7495 $ CALL Bad_environment "TMP"
7496 $ CALL Bad_environment "UNICODE"
7497 $ CALL Bad_environment "UTIL"
7498 $ CALL Bad_environment "TEST" "SYMBOL"
7499 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
7500 $!
7501 $! %Config-I-VMS, write perl_setup.com here
7502 $!
7503 $ IF (.NOT.perl_symbol)
7504 $ THEN
7505 $   file_2_find = "[-]''packageup'.cld"
7506 $   echo ""
7507 $   echo4 "The perl.cld file is now being written..."
7508 $   OPEN/WRITE CONFIG 'file_2_find'
7509 $   ext = ".exe"
7510 $   IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP") THEN ext := .AXE
7511 $   IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_IA64") THEN ext := .IXE
7512 $   IF (use_vmsdebug_perl)
7513 $   THEN
7514 $     WRITE CONFIG "define verb dbgperl"
7515 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
7516 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7517 $     WRITE CONFIG ""
7518 $     WRITE CONFIG "define verb perl"
7519 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
7520 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7521 $   ELSE
7522 $     WRITE CONFIG "define verb perl"
7523 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
7524 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7525 $   ENDIF
7526 $   CLOSE CONFIG
7527 $ ENDIF ! (.NOT.perl_symbol)
7528 $ echo ""
7529 $ echo4 "The perl_setup.com file is now being written..."
7530 $ file_2_find = "[-]perl_setup.com"
7531 $!
7532 $! Folks are likely to want to edit perl_setup.com.
7533 $! STMLF RFM plays nicer with ported editors than does VFC.
7534 $!
7535 $ CREATE [-]CONFIG.FDL
7536 $ DECK
7537 RECORD
7538   FORMAT STREAM_LF
7539 $ EOD
7540 $ CREATE /FDL=[-]CONFIG.FDL 'file_2_find'
7541 $ OPEN/APPEND CONFIG 'file_2_find'
7542 $ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;
7543 $ WRITE CONFIG "$!"
7544 $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
7545 $ IF cf_email.NES.perladmin
7546 $ THEN
7547 $ WRITE CONFIG "$! perl configured by ''cf_email'"
7548 $ ELSE
7549 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
7550 $ ENDIF
7551 $ WRITE CONFIG "$!"
7552 $ WRITE CONFIG "$ if P1 .EQS. """""
7553 $ WRITE CONFIG "$ then"
7554 $ WRITE CONFIG "$   myproc = f$environment(""PROCEDURE"")"
7555 $ WRITE CONFIG "$   myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
7556 $ WRITE CONFIG "$   myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
7557 $ WRITE CONFIG "$   myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
7558 $ WRITE CONFIG "$   myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
7559 $ WRITE CONFIG "$   myroot_dir = myroot_dir - ""]["" - ""><"""
7560 $ WRITE CONFIG "$   myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
7561 $ WRITE CONFIG "$   root_spec = myroot_dev + ""["" + myroot_dir + "".]"""
7562 $ WRITE CONFIG "$ else"
7563 $ WRITE CONFIG "$   root_spec = P1"
7564 $ WRITE CONFIG "$ endif"
7565 $ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' 'root_spec'"
7566 $ WRITE CONFIG "$ ext = "".exe"""
7567 $ IF sharedperl
7568 $ THEN
7569 $ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 2 then ext = "".AXE"""
7570 $ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 3 then ext = "".IXE"""
7571 $ ENDIF
7572 $ IF (perl_symbol)
7573 $ THEN
7574 $   perl_setup_perl = "'" + "'perl'" ! triple quoted foreign command symbol
7575 $   IF (use_vmsdebug_perl)
7576 $   THEN
7577 $     WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgperl'ext'"
7578 $     WRITE CONFIG "$ perl    :== $''vms_prefix':[000000]ndbgperl'ext'"
7579 $     WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
7580 $   ELSE
7581 $     WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
7582 $     WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
7583 $   ENDIF
7584 $ ELSE ! .NOT.perl_symbol
7585 $   perl_setup_perl = "perl" ! command verb
7586 $   IF (use_vmsdebug_perl)
7587 $   THEN
7588 $     WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
7589 $   ELSE
7590 $     WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
7591 $   ENDIF
7592 $   IF perl_verb .EQS. "PROCESS"
7593 $   THEN
7594 $     WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
7595 $   ENDIF
7596 $ ENDIF !  perl_symbol
7597 $!
7598 $ IF (tzneedset)
7599 $ THEN
7600 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7601 $ ELSE    !leave in but commented out (in case setting was from perl :-)
7602 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7603 $ ENDIF
7604 $ WRITE CONFIG "$!"
7605 $ WRITE CONFIG "$! Symbols for Perl-based utility programs:"
7606 $ WRITE CONFIG "$!"
7607 $ WRITE CONFIG "$ corelist   == """ + perl_setup_perl + " ''vms_prefix':[utils]corelist.com"""
7608 $ WRITE CONFIG "$ cpan       == """ + perl_setup_perl + " ''vms_prefix':[utils]cpan.com"""
7609 $ WRITE CONFIG "$ enc2xs     == """ + perl_setup_perl + " ''vms_prefix':[utils]enc2xs.com"""
7610 $ WRITE CONFIG "$ encguess   == """ + perl_setup_perl + " ''vms_prefix':[utils]encguess.com"""
7611 $ WRITE CONFIG "$ h2ph       == """ + perl_setup_perl + " ''vms_prefix':[utils]h2ph.com"""
7612 $ WRITE CONFIG "$ h2xs       == """ + perl_setup_perl + " ''vms_prefix':[utils]h2xs.com"""
7613 $ WRITE CONFIG "$ instmodsh  == """ + perl_setup_perl + " ''vms_prefix':[utils]instmodsh.com"""
7614 $ WRITE CONFIG "$ json_pp    == """ + perl_setup_perl + " ''vms_prefix':[utils]json_pp.com"""
7615 $ WRITE CONFIG "$ libnetcfg  == """ + perl_setup_perl + " ''vms_prefix':[utils]libnetcfg.com"""
7616 $ WRITE CONFIG "$ perlbug    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlbug.com"""
7617 $ WRITE CONFIG "$ perldoc    == """ + perl_setup_perl + " ''vms_prefix':[utils]perldoc.com """"-t"""""""
7618 $ WRITE CONFIG "$ perlivp    == """ + perl_setup_perl + " ''vms_prefix':[utils]perlivp.com"""
7619 $ WRITE CONFIG "$ perlthanks == """ + perl_setup_perl + " ''vms_prefix':[utils]perlthanks.com"""
7620 $ WRITE CONFIG "$ piconv     == """ + perl_setup_perl + " ''vms_prefix':[utils]piconv.com"""
7621 $ WRITE CONFIG "$ pl2pm      == """ + perl_setup_perl + " ''vms_prefix':[utils]pl2pm.com"""
7622 $ WRITE CONFIG "$ pod2html   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2html.com"""
7623 $ WRITE CONFIG "$ pod2text   == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2text.com"""
7624 $ WRITE CONFIG "$!pod2man    == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2man.com"""
7625 $ WRITE CONFIG "$ pod2usage  == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2usage.com"""
7626 $ WRITE CONFIG "$ podchecker == """ + perl_setup_perl + " ''vms_prefix':[utils]podchecker.com"""
7627 $ WRITE CONFIG "$ podselect  == """ + perl_setup_perl + " ''vms_prefix':[utils]podselect.com"""
7628 $ WRITE CONFIG "$ prove      == """ + perl_setup_perl + " ''vms_prefix':[utils]prove.com"""
7629 $ WRITE CONFIG "$ ptar       == """ + perl_setup_perl + " ''vms_prefix':[utils]ptar.com"""
7630 $ WRITE CONFIG "$ ptardiff   == """ + perl_setup_perl + " ''vms_prefix':[utils]ptardiff.com"""
7631 $ WRITE CONFIG "$ ptargrep   == """ + perl_setup_perl + " ''vms_prefix':[utils]ptargrep.com"""
7632 $ WRITE CONFIG "$ shasum     == """ + perl_setup_perl + " ''vms_prefix':[utils]shasum.com"""
7633 $ WRITE CONFIG "$ splain     == """ + perl_setup_perl + " ''vms_prefix':[utils]splain.com"""
7634 $ WRITE CONFIG "$ xsubpp     == """ + perl_setup_perl + " ''vms_prefix':[utils]xsubpp.com"""
7635 $ WRITE CONFIG "$ zipdetails == """ + perl_setup_perl + " ''vms_prefix':[utils]zipdetails.com"""
7636 $ CLOSE CONFIG
7637 $!
7638 $ echo  ""
7639 $ echo  "The file can be found at:"
7640 $ echo4 "    ''F$SEARCH(file_2_find)'"
7641 $ echo  "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
7642 $ echo  "when you are satisfied with a successful compilation,"
7643 $ echo  "testing, and installation of your perl."
7644 $ echo  ""
7645 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
7646 $ THEN
7647 $   file_2_find = "[-]''packageup'_install.com"
7648 $   OPEN/WRITE CONFIG 'file_2_find'
7649 $   WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
7650 $   WRITE CONFIG "    /output=sys$common:[syslib]dcltables.exe"
7651 $   WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
7652 $   CLOSE CONFIG
7653 $   echo4 ""
7654 $   echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
7655 $   echo4 "    @ ''F$SEARCH(file_2_find)'"
7656 $   echo4 "after a successful build, test, and install.  Do so with CMKRNL privilege."
7657 $   echo4 ""
7658 $ ENDIF
7659 $!
7660 $!figure out where we "are" by parsing 'vms_default_directory_name' 
7661 $!
7662 $ set_def_command = ""
7663 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
7664 $ tmp = vms_default_directory_name - dflt - "]"
7665 $ i = 0
7666 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
7667 $Set_def_loop:
7668 $ tmp1 = F$ELEMENT(i,".",tmp)
7669 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
7670 $ IF i .EQ. 0 
7671 $ THEN set_def_command = "set default [-"
7672 $ ELSE set_def_command = set_def_command + "-"
7673 $ ENDIF
7674 $ i = i + 1
7675 $ GOTO Set_def_loop
7676 $Beyond_set_def_loop:
7677 $ IF set_def_command.NES.""
7678 $ THEN
7679 $   set_def_command = set_def_command - "-" + "]"
7680 $   echo4 ""
7681 $   echo4 "In order to build ''package' you must now issue the commands:"
7682 $   echo4 ""
7683 $   echo4 " ''set_def_command'"
7684 $ ELSE
7685 $   echo4 ""
7686 $   echo4 "In order to build ''package' you must now issue the command:"
7687 $   echo4 ""
7688 $ ENDIF
7689 $ echo4 " ''make'''makefile'", macros
7690 $ echo4 ""
7691 $!
7692 $ IF ( F$SEARCH("config.msg").NES."" ) 
7693 $ THEN
7694 $   echo4 "Hmm.  I also noted the following information while running:"
7695 $   echo4 ""
7696 $   TYPE/OUTPUT=SYS$ERROR: config.msg
7697 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
7698 $   DELETE/NOLOG/NOCONFIRM config.msg;
7699 $ ENDIF
7700 $!
7701 $Clean_up:
7702 $ SET NOON
7703 $ IF (silent)
7704 $ THEN
7705 $   CLOSE/NOLOG STDOUT
7706 $   DEASSIGN SYS$OUTPUT
7707 $ ENDIF
7708 $ CLOSE/NOLOG CONFIG
7709 $ IF F$GETJPI("","FILCNT").GT.vms_filcnt
7710 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
7711 $ ENDIF
7712 $ dflt = F$ENVIRONMENT("DEFAULT")
7713 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
7714 $ THEN
7715 $   IF ( F$SEARCH("[.CXX_REPOSITORY]*.*").NES."" ) 
7716 $   THEN 
7717 $     DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
7718 $     SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
7719 $   ENDIF
7720 $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
7721 $   SET DEFAULT [-]
7722 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
7723 $   DELETE/NOLOG/NOCONFIRM UU.DIR;
7724 $ ENDIF
7725 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
7726 $ EXIT
7727 $!: End of Configure