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