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