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