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