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