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