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