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