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