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