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