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