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