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