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