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