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