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