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