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