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