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