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