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