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