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