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