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