Re: [PATCH] [ID 20000820.012] Not OK: perl v5.7.0 +SUIDMAIL +DEVEL6735 on
[p5sagit/p5-mst-13.2.git] / configure.com
1 $ sav_ver = 'F$VERIFY(0)
2 $! SET VERIFY
3 $!
4 $! For example, if you unpacked perl into: [USER.PERL-5n...] then you will 
5 $! want to cd into the tree and execute Configure:
6 $!
7 $! $ SET DEFAULT [USER.PERL5_xxx]
8 $! $ @Configure 
9 $!
10 $! or
11 $!
12 $! $ SET DEFAULT [USER.PERL5_xxx]
13 $! $ @Configure "-des"
14 $!
15 $! That's it. If you get into a bind trying to build perl on VMS then 
16 $! definitely read through the README.VMS file.
17 $! Beyond that send email to vmsperl@perl.org
18 $!
19 $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
20 $!
21 $! send suggestions to: 
22 $!  Dan Sugalski <dan@sidhe.org>
23 $! Thank you!!!!
24 $!
25 $! Adapted and converted from Larry Wall & Andy Dougherty's
26 $! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
27 $! (a Bourne sh[ell] script for configuring the installation of perl 
28 $! on non-VMS systems) in the perl5.002|3 epoch (spring/summer 1996)
29 $! with much valuable help from Charles Bailey & 
30 $! the whole VMSPerl crew.
31 $! Extended and messed about with by Dan Sugalski
32 $!
33 $ sav_ver = F$VERIFY(0)
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"
41 $ ans = ""
42 $ macros = ""
43 $ extra_flags = ""
44 $ user_c_flags = ""
45 $ use_ieee_math = "n"
46 $ be_case_sensitive = "n"
47 $ use_vmsdebug_perl = "n"
48 $ use64bitall = "n"
49 $ use64bitint = "n"
50 $ C_Compiler_Replace = "CC="
51 $ Thread_Live_Dangerously = "MT="
52 $ use_two_pot_malloc = "N"
53 $ use_pack_malloc = "N"
54 $ use_debugmalloc = "N"
55 $ ccflags = ""
56 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
57 $ max_allowed_dir_depth = 3  ! e.g. [A.B.PERLxxx] not [A.B.C.PERLxxx]
58 $! max_allowed_dir_depth = 2 ! e.g. [A.PERLxxx] not [A.B.PERLxxx]
59 $!
60 $ vms_filcnt = F$GETJPI ("","FILCNT")
61 $!
62 $!: compute my invocation name
63 $ me = F$ENVIRONMENT("PROCEDURE")
64 $!
65 $! Many null statements (begin with colon ':') in the Bourne shell version of
66 $! this script serve as comments/placeholders. I have retained some of the ones
67 $! that will help you compare this .COM file to the sh version - as well as
68 $! leave placeholders for future improvements to this .COM file.
69 $! sfn = VMS "skipped for now"
70 $!
71 $!: Proper PATH separator                              !sfn
72 $!: Proper PATH setting                                !sfn
73 $!: Sanity checks                                      !sfn "Say '@''$me''"
74 $!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
75 $!: Configure runs within the UU subdirectory          !->after find MANIFEST
76 $!   <big long list of default values (mostly null)>
77 $!: We must find out about Eunice early                !(?)
78 $!: list of known cpp symbols, sorted alphabetically   !sfn
79 $!   al = al + "..."
80 $!: default library list                               !sfn
81 $!   <no hints files in use (yet?)>
82 $!: Extra object files, if any, needed on this platform. !sfn
83 $!: Possible local include directories to search.      !sfn
84 $!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
85 $!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
86 $!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
87 $!: no include file wanted by default                  !sfn
88 $!inclwanted=''                                        !sfn
89 $!: Possible local library directories to search.      !sfn
90 $!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
91 $!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
92 $!: general looking path for locating libraries        !sfn
93 $!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
94 $!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
95 $!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
96 $!: Private path used by Configure to find libraries.  Its value !sfn
97 $!: is prepended to libpth. This variable takes care of special !sfn
98 $!: machines, like the mips.  Usually, it should be empty. !sfn
99 $!plibpth=''                                           !sfn
100 $!: full support for void wanted by default            !sfn
101 $!defvoidused=15                                       !sfn
102 $!: List of libraries we want.                         !sfn
103 $!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
104 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
105 $!libswanted="$libswanted ucb bsd BSD PW x"            !sfn
106 $!: We probably want to search /usr/shlib before most other libraries. !sfn
107 $!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
108 $!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
109 $!glibpth="/usr/shlib $glibpth"                        !sfn
110 $!: Do not use vfork unless overridden by a hint file. !sfn
111 $!usevfork=false                                       !sfn
112 $!: script used to extract .SH files with variable substitutions !sfn
113 $!: produce awk script to parse command line options   !sfn
114 $!sfn (assume no sed awk) see below
115 $!: process the command line options         
116 $!
117 $!: set up default values
118 $ fastread=""
119 $ reuseval="false"
120 $ maniskip = "false"
121 $ IF F$TYPE(config_sh) .EQS. "" THEN config_sh=""
122 $ alldone=""
123 $ error=""
124 $ silent=""
125 $ extractsh=""
126 $ override=""
127 $ knowitall=""
128 $ Using_Dec_C = "n"
129 $ Using_Gnu_C = "n"
130 $ using_cxx = "n"
131 $ Dec_C_Version = ""
132 $ cxxversion = ""
133 $ use_threads = "F"
134 $ use_5005_threads = "N"
135 $ use_ithreads = "N"
136 $!
137 $!: option parsing
138 $ config_args = ""
139 $ IF (P1 .NES. "")
140 $ THEN            !one or more switches was thrown
141 $   i = 1
142 $   bang = 0
143 $Param_loop:
144 $   IF (P'i'.NES."") 
145 $   THEN
146 $     bang = bang + 1
147 $     config_args = config_args + F$FAO(" !AS",P'i')
148 $   ENDIF
149 $   i = i + 1
150 $   IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
151 $!
152 $   i = 1
153 $Opt_loop:
154 $   IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
155 $   IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
156 $Remove_quotation_mark:
157 $   P'i' = P'i' - """"
158 $   IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
159 $   gotopt      = "f" !"alse"
160 $   gotshortopt = "f" !"alse"
161 $   IF (F$EXTRACT(0,1,P'i') .EQS. "d")
162 $   THEN
163 $     fastread    = "yes"
164 $     gotopt      = "t" !"rue"
165 $     P'i'        = P'i' - "d"
166 $     gotshortopt = "t" !"rue"
167 $   ENDIF
168 $   IF (F$EXTRACT(0,1,P'i') .EQS. "e")
169 $   THEN
170 $     alldone = "cont"
171 $     gotopt = "t"
172 $     P'i' = P'i' - "e"
173 $     gotshortopt = "t"
174 $   ENDIF
175 $   IF (F$EXTRACT(0,1,P'i') .EQS. "f") ! "-f"
176 $   THEN
177 $     P'i' = P'i' - "f"
178 $     config_sh = P'i'
179 $     IF (F$SEARCH(config_sh).NES."")
180 $     THEN
181 $       test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
182 $       IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh)) 
183 $       THEN
184 $         config_dflt = "y"
185 $         CONTINUE !at this point check UIC && if test allows...
186 $                  !to be continued ?
187 $       ELSE
188 $         echo "''me': cannot read config file ''config_sh'."
189 $         error="true"
190 $       ENDIF
191 $     ELSE
192 $       echo "''me': cannot read config file ''config_sh'."
193 $       error="true"
194 $     ENDIF
195 $     gotopt = "t"
196 $   ENDIF
197 $   IF (F$EXTRACT(0,1,P'i') .EQS. "h") ! "-h"
198 $   THEN
199 $     error = "true"
200 $     gotopt = "t"
201 $     P'i' = P'i' - "h"
202 $     gotshortopt = "t"
203 $   ENDIF
204 $   IF (F$EXTRACT(0,1,P'i') .EQS. "m")  ! "-m"
205 $   THEN
206 $     maniskip = "true"
207 $     gotopt = "t"
208 $     P'i' = P'i' - "m"
209 $     gotshortopt = "t"
210 $   ENDIF
211 $   IF (F$EXTRACT(0,1,P'i') .EQS. "r")  ! "-r"
212 $   THEN
213 $     reuseval = "true"
214 $     gotopt = "t"
215 $     P'i' = P'i' - "r"
216 $     gotshortopt = "t"
217 $   ENDIF
218 $   IF (F$EXTRACT(0,1,P'i') .EQS. "s") ! "-s"
219 $   THEN
220 $     silent = "true"
221 $     gotopt = "t"
222 $     P'i' = P'i' - "s"
223 $     gotshortopt = "t"
224 $   ENDIF
225 $   IF (F$EXTRACT(0,1,P'i') .EQS. "E") ! "-E"
226 $   THEN
227 $     alldone = "exit"
228 $     gotopt = "t"
229 $   ENDIF
230 $   IF (F$EXTRACT(0,1,P'i') .EQS. "K") ! "-K"
231 $   THEN
232 $     knowitall = "true"
233 $     gotopt = "t"
234 $     P'i' = P'i' - "K"
235 $     gotshortopt = "t"
236 $   ENDIF
237 $   IF (F$EXTRACT(0,1,P'i') .EQS. "O") ! "-O"
238 $   THEN
239 $     override = "true"
240 $     gotopt = "t"
241 $     P'i' = P'i' - "O"
242 $     gotshortopt = "t"
243 $   ENDIF
244 $   IF (F$EXTRACT(0,1,P'i') .EQS. "S") ! "-S"
245 $   THEN
246 $     extractsh = "true"  !VMS?  Yes with munchconfig
247 $     gotopt = "t"
248 $     P'i' = P'i' - "S"
249 $     gotshortopt = "t"
250 $   ENDIF
251 $   IF (F$EXTRACT(0,1,P'i') .EQS. "D") ! "-D"
252 $   THEN
253 $     P'i' = P'i' - "D"
254 $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
255 $     THEN
256 $       tmp = P'i' + "=""define"""
257 $       'tmp
258 $       DELETE/SYMBOL tmp
259 $     ELSE 
260 $       IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
261 $       THEN
262 $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
263 $         echo "''me': use '-Usymbol=val' not '-Dsymbol='."
264 $         echo "''me': ignoring -D",P'i'
265 $       ELSE
266 $          tmp = F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')
267 $          tmp = tmp + "=""" + F$EXTRACT(F$LOCATE("=",P'i')+1,F$LENGTH(P'i'),P'i') + """"
268 $         'tmp
269 $         DELETE/SYMBOL tmp
270 $       ENDIF
271 $     ENDIF
272 $     gotopt = "t"
273 $   ENDIF
274 $   IF (F$EXTRACT(0,1,P'i') .EQS. "U") ! "-U"
275 $   THEN
276 $     P'i' = P'i' - "U"
277 $     IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
278 $     THEN
279 $       tmp = P'i' + "="""""
280 $       'tmp
281 $       DELETE/SYMBOL tmp
282 $     ELSE 
283 $       IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
284 $       THEN
285 $         me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
286 $         echo "''me': use '-Dsymbol=val' not '-Usymbol=val'."
287 $         echo "''me': ignoring -U",P'i'
288 $       ELSE
289 $         tmp = P'i' + "=""undef"""
290 $         'tmp
291 $         DELETE/SYMBOL tmp
292 $       ENDIF
293 $     ENDIF
294 $     gotopt = "t"
295 $   ENDIF
296 $   IF (F$EXTRACT(0,1,P'i') .EQS. "V")
297 $   THEN
298 $     me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
299 $     echo "''me' generated by an unknown version of EDT."
300 $     STOP
301 $     EXIT
302 $   ENDIF
303 $   IF .NOT.gotopt 
304 $   THEN
305 $     echo "''me': unknown option ",P'i'
306 $     error = "true"
307 $   ENDIF
308 $   IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
309 $   i = i + 1 
310 $   IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
311 $!
312 $ ENDIF  ! (P1 .NES. "")
313 $ config_args = F$EDIT(config_args,"TRIM")
314 $!
315 $ IF (error)
316 $ THEN
317 $   me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
318 $   echo "Usage: @''me' [-dehmrEKOSV] [-fconfig.sh] [-Dsymbol] [-Dsymbol=value]"
319 $   echo "                [-Usymbol]  [-Usymbol=]"
320 $   TYPE SYS$INPUT
321  "-d" : use defaults for all answers.
322  "-e" : go on without questioning past the production of config.sh.    *
323  "-f" : specify an alternate default configuration file.
324  "-h" : print this help message and exit (with an error status).
325  "-m" : skip the MANIFEST check to see that all files are present
326  "-r" : reuse C symbols value if possible (skips costly nm extraction).*
327  "-s" : silent mode, only echoes questions and essential information.
328  -"D" : define symbol to have some value:                              *
329          -"Dsymbol"         symbol gets the value 'define'
330          -"Dsymbol=value"   symbol gets the value 'value'
331   -E  : stop at the end of questions, after having produced config.sh. *
332   -K  : do not use unless you know what you are doing.
333   -O  : let -D and -U override definitions from loaded configuration file. *
334   -S  : perform variable substitutions on all .SH files (can mix with -f) *
335  -"U" : undefine symbol:                                               *
336          -"Usymbol"    symbol gets the value 'undef'
337          -"Usymbol="   symbol gets completely empty
338   -V  : print version number and exit (with a zero status).
339 $   echo "%Config-I-VMS, lower case switches must be enclosed"
340 $   echo "-Config-I-VMS, in double quotation marks, e.g.:"
341 $   echo "-Config-I-VMS,   @Configure ""-des"""
342 $   echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
343 $   SET DEFAULT 'vms_default_directory_name' !be kind rewind
344 $   STOP
345 $   EXIT 3 ! $STATUS = "%X00000003" (informational)
346 $ ENDIF
347 $!
348 $ GOTO Check_silence
349 $!
350 $Shut_up:
351 $ IF F$Mode() .eqs. "BATCH"
352 $ THEN
353 $   STDOUT = F$GetQuI("DISPLAY_JOB","LOG_SPECIFICATION",,"THIS_JOB")
354 $   WRITE SYS$OUTPUT "Warning: Executing in batch mode.  To avoid file locking conflicts,"
355 $   WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
356 $   WRITE SYS$OUTPUT STDOUT
357 $ ELSE
358 $   STDOUT = F$TRNLNM("SYS$OUTPUT")
359 $ ENDIF
360 $ DEFINE SYS$OUTPUT "_NLA0:"
361 $ echo4 = "write STDOUT "
362 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
363 $ open/write/share=read STDOUT 'STDOUT'
364 $ RETURN
365 $!
366 $Check_silence:
367 $ IF (silent) 
368 $ THEN
369 $   GOSUB Shut_up
370 $ ELSE
371 $   echo4 = "write SYS$OUTPUT "
372 $   cat4 = "TYPE"
373 $ ENDIF
374 $!
375 $!: run the defines and the undefines, if any, but leave the file out there...
376 $! Unfortunately Configure.COM in DCL is not yet set up to do this - 
377 $! maybe someday
378 $!
379 $!: set package name
380 $ package = "perl5"
381 $ packageup = F$EDIT((package - "5"),"UPCASE")
382 $!
383 $!: Eunice requires " " instead of "", can you believe it
384 $ echo ""
385 $!: Here we go...
386 $ echo "Beginning of configuration questions for ''package'."
387 $ echo ""
388 $!
389 $!: Some greps do not return status, grrr.
390 $ contains = "SEARCH"
391 $!
392 $!: first determine how to suppress newline on echo command !cant DCL is record oriented
393 $! echo "Checking ''echo' to see how to suppress newlines..."
394 $! echo "giving up..."
395 $! echo "The star should be here-->*"
396 $!
397 $!: Now test for existence of everything in MANIFEST
398 $ echo ""
399 $ echo4 "First let's make sure your kit is complete.  Checking..."
400 $ manifestfound = "" 
401 $ miss_list = "" 
402 $! Here I assume we are in the [foo.PERLxxx...] tree
403 $! because the search routine simply does set def [-] if necessary.
404 $ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...] 
405 $Research_manifest:
406 $ manifestfound = F$SEARCH(file_2_find)
407 $ IF (manifestfound .EQS. "")
408 $ THEN
409 $   IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
410 $   THEN
411 $     SET DEFAULT [-]
412 $     GOTO Research_manifest
413 $   ELSE
414 $     echo ""
415 $     echo "There is no MANIFEST file.  I hope your kit is complete !"
416 $     miss_list = ""
417 $     GOTO Beyond_manifest
418 $   ENDIF
419 $ ELSE
420 $! MANIFEST. has been found and we have set def'ed there - 
421 $! time to bail out before it's too late.
422 $ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
423 $ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
424 $   IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("Default")).nes.".")
425 $   THEN
426 $     TYPE SYS$INPUT:
427 %Config-E-VMS, ERROR:
428  Sorry! It apears as though your perl build sub-directory is already too
429  deep into the VMS file system. Please try moving stuff into a shallower 
430  directory (or altering the "max_allowed_dir_depth" parameter).
431 $     echo4 "ABORTING..."
432 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
433 $     STOP
434 $     EXIT !2 !$STATUS = "%X00000002" (error)
435 $   ENDIF
436 $Beyond_depth_check:
437 $!
438 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
439 $!
440 $   IF (manifestfound .NES. "")
441 $   THEN
442 $     IF ( F$SEARCH("UU.DIR").EQS."" )
443 $     THEN
444 $       CREATE/DIRECTORY [.UU]
445 $     ELSE
446 $       IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG [.UU]*.*;*
447 $     ENDIF
448 $!: Configure runs within the UU subdirectory
449 $     SET DEFAULT [.UU]
450 $!
451 $! a little redundancy never hurt anybody?
452 $     file_2_find = "[-]" + file_2_find
453 $     manifestfound = F$SEARCH(file_2_find)
454 $!
455 $     OPEN/WRITE MISSING MISSING.
456 $!change to "FALSE" if you wish to skip the manifest search 
457 $!(which after all is rather slow in DCL :-)
458 $     IF (maniskip)
459 $     THEN
460 $       echo "Skipping MANIFEST check as requested"
461 $     ELSE
462 $!
463 $       OPEN/READ CONFIG 'manifestfound'
464 $Read_loop_manifest:
465 $       READ/END_OF_FILE = Done_manifest CONFIG line
466 $! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
467 $! pvhp@lns62.lns.cornell.edu 10-JUN-1996 20:31:46
468 $! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
469 $! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
470 $       line = F$EDIT(line,"TRIM, COMPRESS")
471 $       file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line) 
472 $       IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find) 
473 $       THEN 
474 $Re_strip_line_manifest:
475 $         loca = F$LOCATE("/",file_2_find)
476 $         ante = F$EXTRACT(0,loca,file_2_find)
477 $         post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
478 $         test_this = ante + "." + (post - "/")
479 $         IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
480 $         THEN 
481 $           file_2_find = ante + "." + (post - "/")
482 $           GOTO Re_strip_line_manifest
483 $         ELSE
484 $           file_2_find = ante + "]" + (post - "/")
485 $         ENDIF
486 $           file_2_find = "[-."+file_2_find
487 $       ELSE
488 $         file_2_find = "[-]" + file_2_find
489 $       ENDIF
490 $!
491 $       dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
492 $       file_2_find = file_2_find - dirname
493 $       dots = 0
494 $Dot_loop:
495 $       dot_ele = F$ELEMENT(dots,".",file_2_find)
496 $       IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
497 $       IF dots .eq. 0
498 $       THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
499 $       ELSE basename = basename + dot_ele + "_"
500 $       ENDIF
501 $       dots = dots + 1
502 $       GOTO dot_loop
503 $Eo_dot_loop:
504 $       IF (((f$length(file_2_find)+1) .eq. f$length(basename)) .and. -
505              (f$extract(f$length(basename)-1,1,basename) .eqs. "_")) THEN -
506           basename = f$extract(0,f$length(basename)-1,basename)
507 $       file_2_find = dirname + basename
508 $!
509 $       found = F$SEARCH(file_2_find)
510 $       IF (found .EQS. "" .AND. dots .GT. 2)
511 $       THEN
512 $! 17-DEC-1999 Improved to turn "[.foo.bar]baz.c_buz" into
513 $! "[.foo.bar]baz_c.buz" to cover unzipped archives and put
514 $! "[.foo.bar]baz.c_buz,baz_c.buz" into missing list if neither is found.
515 $         basename[f$locate(".",basename),1] := _
516 $         dot_ele = F$ELEMENT(dots - 1,"_",basename)
517 $         basename = -
518             f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
519               + "." + dot_ele
520 $         found = F$SEARCH(dirname + basename)
521 $         file_2_find = file_2_find + "," + basename
522 $       ENDIF
523 $       IF (found .EQS. "")
524 $       THEN
525 $         WRITE MISSING file_2_find
526 $         IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
527 $         THEN
528 $           miss_list = miss_list + "," + file_2_find
529 $         ENDIF
530 $       ENDIF
531 $       GOTO Read_loop_manifest
532 $Done_manifest:
533 $       CLOSE CONFIG
534 $     ENDIF  !"TRUE"
535 $     CLOSE MISSING
536 $   ENDIF ! (manifestfound .NES. "")
537 $Beyond_manifest:
538 $   IF (miss_list .NES. "")
539 $   THEN
540 $     echo "Some of the files not found include:"
541 $     cat4 MISSING.
542 $   ENDIF
543 $   IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
544 $   THEN
545 $     TYPE SYS$INPUT:
546
547 THIS PACKAGE SEEMS TO BE INCOMPLETE.
548
549 You have the option of continuing the configuration process, despite the
550 distinct possibility that your kit is damaged, by typing 'y'es.  If you
551 do, don't blame me if something goes wrong.  I advise you to type 'n'o
552 and contact the author (dan@sidhe.org)
553
554 $     READ SYS$COMMAND/PROMPT="Continue? [n] " ans
555 $     IF ans
556 $     THEN
557 $       echo4 "Continuing..."
558 $     ELSE
559 $       echo4 "ABORTING..."
560 $       GOTO Clean_up
561 $     ENDIF
562 $   ELSE
563 $     echo4 "Looks good..."
564 $     DELETE/NOLOG MISSING.;
565 $   ENDIF ! (miss_list .NES. "")
566 $ ENDIF   ! (manifestfound .EQS. "") ELSE 
567 $!
568 $! after finding MANIFEST (see above)
569 $!: Configure runs within the UU subdirectory 
570 $!
571 $!: compute the number of columns on the terminal for proper question formatting
572 $! (sfn, will assume 80-ish)
573 $!
574 $!: set up the echo used in my read              !sfn
575 $!: now set up to do reads with possible shell escape and default assignment !sfn
576 $ GOTO Beyond_myread
577 $!
578 $myread:
579 $ ans = ""
580 $ If (fastread)
581 $ Then
582 $   echo4 "''rp'"
583 $ Else
584 $   If (.NOT. silent) Then echo ""
585 $   READ SYS$COMMAND/PROMPT="''rp'" ans
586 $   IF (ans .EQS. "&-d")
587 $   THEN
588 $     echo4 "(OK, I will run with -d after this question.)"
589 $     IF (.NOT. silent) THEN echo ""
590 $     READ SYS$COMMAND/PROMPT="''rp'" ans
591 $     fastread := yes
592 $   ENDIF
593 $   IF (ans .EQS. "&-s")
594 $   THEN
595 $     echo4 "(OK, I will run with -s after this question.)"
596 $     echo ""
597 $     READ SYS$COMMAND/PROMPT="''rp'" ans
598 $     silent := true
599 $     GOSUB Shut_up
600 $   ENDIF
601 $ Endif
602 $ RETURN
603 $!
604 $Beyond_myread:
605 $!
606 $!: create .config dir to save info across Configure sessions
607 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
608 $ THEN
609 $   CREATE/DIRECTORY [-.CONFIG]
610 $   OPEN/WRITE CONFIG [-.CONFIG]README.
611 $   WRITE CONFIG -
612       "This directory created by Configure to save information that should"
613 $   WRITE CONFIG -
614       "persist across sessions."
615 $   WRITE CONFIG ""
616 $   WRITE CONFIG -
617       "You may safely delete it if you wish."
618 $   CLOSE CONFIG
619 $ ENDIF
620 $!
621 $!: general instructions
622 $ needman = "true"
623 $ firsttime = "true"
624 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
625 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
626 $ THEN
627 $   messages = F$ENVIRONMENT("MESSAGE")
628 $   SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
629 $   contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
630 $   IF .NOT.($status.EQ.%X08D78053)
631 $   THEN
632 $     firsttime=""
633 $     dflt = "n"
634 $     rp = "Would you like to see the instructions? [''dflt'] "
635 $     GOSUB myread
636 $     if .NOT.ans THEN needman=""
637 $   ENDIF
638 $   SET MESSAGE 'messages'
639 $ ENDIF
640 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
641 $!
642 $ IF (needman)
643 $ THEN
644 $   TYPE SYS$INPUT:
645
646 This installation shell script will examine your system and ask you questions
647 to determine how the perl5 package should be installed. If you get
648 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
649 process, edit something, then restart this process as you just did.
650 Many of the questions will have default answers in square
651 brackets; typing carriage return will give you the default.
652
653 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
654 $   TYPE SYS$INPUT:
655
656 In a hurry? You may run '@Configure "-d"'.  This will bypass nearly all
657 the questions and use the computed defaults (or the previous answers provided 
658 there was already a config.sh file). Type '@Configure "-h"' for a list of 
659 options.
660
661 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
662 $   TYPE SYS$INPUT:
663
664 Much effort has been expended to ensure that this shell script will
665 run on any VMS system.  If despite that it blows up on yours, your
666 best bet is to edit Configure.com and @ it again.  Whatever problems
667 you have with Configure.com, let me (dan@sidhe.org) know how I blew
668 it.
669
670 $!This installation script affects things in two ways:
671 $!
672 $!1) it may do direct variable substitutions on some of the files included
673 $!   in this kit.
674 $!2) it builds a config.h file for inclusion in C programs.  You may edit
675 $!   any of these files as the need arises after running this script.
676 $!
677 $!If you make a mistake on a question, there is no easy way to back up to it
678 $!currently.
679 $!
680 $   READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
681 $   IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
682 $   THEN
683 $     OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
684 $     WRITE CONFIG user 
685 $     CLOSE CONFIG
686 $   ENDIF
687 $ ENDIF  !(needman .EQS. "true")
688 $!
689 $!: see if sh knows # comments             !sfn
690 $ sharpbang = "$ "
691 $!: figure out how to guarantee sh startup !sfn
692 $!: find out where common programs are     !sfn
693 $!loclist="awk/cat/comm/cp/echo/expr/find/grep/ln/ls/mkdir/rm/sed/sort/touch/tr/uniq"
694 $!trylist="Mcc/byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
695 $! echo "I don't know where '$file' is, and my life depends on it."
696 $! echo "Go find a public domain implementation or fix your PATH setting!"
697 $! echo ""
698 $! echo "Don't worry if any of the following aren't found..."
699 $!: determine whether symbolic links are supported !sfn
700 $!: see whether [:lower:] and [:upper:] are supported character classes !sfn
701 $!: set up the translation script tr, must be called with ./tr of course !sfn
702 $!
703 $!: Try to determine whether config.sh was made on this system
704 $!: Get old answers from old config file if Configure was run on the
705 $!: same system, otherwise use the hints.
706 $ config_sh_es = "''config_sh'/[-]config.sh/[-.vms]config.vms/"
707 $ i = 0
708 $ max = 3
709 $Config_sh_look:
710 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
711 $ i = i + 1
712 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
713 $ THEN
714 $   configshfound = F$SEARCH(config_sh)
715 $   IF (configshfound.NES."") THEN GOTO Config_sh_found
716 $ ENDIF
717 $ IF (i.LT.max) THEN GOTO Config_sh_look
718 $! genconfig.pl has "osname='VMS'"
719 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE") 
720 $ IF (configshfound.EQS."")
721 $ THEN
722 $   config_sh = "[-]config.sh" ! the fallback default
723 $   GOTO Beyond_config_sh
724 $ ENDIF
725 $Config_sh_found:
726 $ IF F$TYPE(config_dflt) .EQS. "" THEN config_dflt = "n"
727 $ rp = "Shall I @ ''config_sh' for default answers? [''config_dflt'] "
728 $ GOSUB myread
729 $ IF ans
730 $ THEN
731 $   echo ""
732 $   echo "Fetching default answers from ''config_sh'..."
733 $!
734 $! This @ is why config_sh must employ DCL syntax.  Note that for
735 $! symbols to be returned to this procedure they must be global.
736 $! Which implies that assignments must be of the :== or == variety.
737 $! Note further that the [-]config.sh file written by this procedure
738 $! employs shell syntax.  In order to convert shell syntax to DCL
739 $! you might try:
740 $!
741 $! perl -ni -e "s/^#/!#/;s/='/==""/;s/'$/""/;print ""\$ $_"";" config.sh
742 $!
743 $! However, watch out for sig_nam, sig_nam_init, sig_num, startperl 
744 $! and any of the lower case double quoted variables such as the *format
745 $! variables in such a config."sh".
746 $!
747 $   @'config_sh
748 $!
749 $ ENDIF
750 $ DELETE/SYMBOL config_dflt
751 $!
752 $!we actually do not have "hints/" for VMS
753 $!     TYPE SYS$INPUT:
754 $!
755 $!First time through, eh?  I have some defaults handy for the following systems:
756 $!
757 $!     echo "     ","VMS_VAX"
758 $!     echo "     ","VMS_AXP"
759 $!        : Now look for a hint file osname_osvers, unless one has been
760 $!        : specified already.
761 $!     TYPE SYS$INPUT:
762 $!
763 $!You may give one or more space-separated answers, or "none" if appropriate.
764 $!If your OS version has no hints, DO NOT give a wrong version -- say "none".
765 $!
766 $!     READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
767 $!
768 $Beyond_config_sh:
769 $!
770 $!: Restore computed paths          !sfn
771 $!
772 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
773 $!
774 $ IF (osname .NES. "VMS")
775 $ THEN
776 $   echo4 "Hmm.. I wonder what ''osname' is (?)"
777 $   TYPE SYS$INPUT:
778
779 %Config-E-VMS, ERROR:
780
781            Err, you do not appear to be running VMS!
782  This procedure is intended to Configure the building of Perl for VMS.
783
784 $   READ SYS$COMMAND/PROMPT="Continue anyway? [n] " ans
785 $   IF ans
786 $   THEN
787 $     echo4 "Continuing..."
788 $   ELSE
789 $     echo4 "ABORTING..."
790 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
791 $     STOP
792 $     EXIT 2 !$STATUS = "%X00000002" (error)
793 $   ENDIF
794 $ ELSE           !we are on VMS huzzah!
795 $   IF .NOT.silent 
796 $   THEN TYPE SYS$INPUT:
797
798 Configure uses the operating system name and version to set some defaults.
799 The default value is probably right if the name rings a bell. Otherwise,
800 since spelling matters for me, either accept the default or answer "none"
801 to leave it blank.
802 $   ENDIF
803 $   rp = "Operating system name? [''osname'] "
804 $   GOSUB myread
805 $   IF ans.nes.""
806 $   THEN
807 $     IF (ans.NES.osname) !.AND.knowitall
808 $     THEN
809 $       echo4 "I'll go with ''osname' anyway..."
810 $     ENDIF
811 $   ENDIF
812 $ ENDIF !(osname .NES./.EQS. "VMS")
813 $!
814 $!: who configured the system
815 $ cf_by = F$EDIT(user,"LOWERCASE")
816 $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
817 $!
818 $! Peter Prymmer has seen:
819 $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-46800"  (sic)
820 $!  "SYS$TIME_ZONE" = "EDT"
821 $!
822 $! Charles Lane recommended:
823 $!  "SYS$TIMEZONE_DIFFERENTIAL" = "-14400"
824 $!  "NEWS_TIMEZONE" = "-0500"
825 $!  "ST_TIMEZONE" = "EDT"
826 $!  "JAN_TIME_ZONE" = "EST  "
827 $!  "MULTINET_TIMEZONE" = "EST"
828 $!  "DAYLIGHT_SAVINGS"  = "1"
829 $!
830 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
831 $!   "PMDF_Timezone"
832 $!   "Multinet_Timezone"
833 $!   "TCPware_Timezone"
834 $!   "WIN$Time_Zone"
835 $!
836 $! This snippet o' DCL returns a string in default Unix `date` format,
837 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
838 $!
839 $ MIN_TZO = -840  !units are minutes here
840 $ MAX_TZO =  840
841 $!
842 $ wkday  = F$EXTRACT(0,3,F$CVTIME(,,"WEEKDAY"))
843 $ monn   = F$CVTIME(,,"MONTH")
844 $ mday   = F$EXTRACT(8,2,F$CVTIME(,,"DATE"))
845 $ hour   = F$CVTIME(,,"HOUR")
846 $ min    = F$CVTIME(,,"MINUTE")
847 $ sec    = F$CVTIME(,,"SECOND")
848 $ year   = F$CVTIME(,,"YEAR")
849 $!
850 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
851 $ i = 0
852 $Mon_loop:
853 $ i = i + 1
854 $ mon = F$ELEMENT(i,"/",months)
855 $ IF i.LT.monn THEN GOTO Mon_loop
856 $!
857 $ tzneedset = "t"
858 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
859 $ IF systz.NES.""
860 $ THEN
861 $   tzhour = F$INTEGER(systz)/3600
862 $   tzmins = F$INTEGER(systz)/60
863 $   tzminrem = tzmins - tzhour*60
864 $   IF tzminrem.lt.0 THEN tzminrem = -1*tzminrem  !keeps !2ZL happy
865 $   IF tzhour.ge.0 
866 $   THEN signothetime = "+" 
867 $     IF tzhour.EQ.0.AND.tzminrem.EQ.0 
868 $     THEN direction = "on GMT/"
869 $     ELSE direction = "east of "
870 $     ENDIF
871 $   ELSE signothetime = "-"
872 $     tzhour = -1*tzhour                          !keeps !UL happy
873 $     direction = "west of "
874 $   ENDIF
875 $   echo ""
876 $   echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
877 $   IF tzminrem.ne.0
878 $   THEN
879 $     tzspan = "''tzhour' hours & ''tzminrem' minutes"
880 $   ELSE
881 $     tzspan = "''tzhour' hours"
882 $   ENDIF
883 $   dflt = "y"
884 $   echo "Your system is ''tzspan' ''direction'UTC in England."
885 $   rp = "(''systz') Is this UTC Time Zone Offset correct? [''dflt'] "
886 $   GOSUB myread
887 $   IF ans.OR.(ans.EQS."") 
888 $   THEN 
889 $     tzneedset = "f"
890 $     tzd = systz
891 $     GOTO Beyond_TimeZone
892 $   ENDIF
893 $ ELSE
894 $   echo ""
895 $   echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
896 $ ENDIF
897 $!
898 $TZSet:
899 $ echo ""
900 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
901 $ echo "you are.  As an example Eastern (US) Standard Time is -5:00 offset, but"
902 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
903 $ dflt = "0:00"
904 $ rp = "Enter the Time Zone offset: [''dflt'] "
905 $ GOSUB myread
906 $ ans = F$Edit(ans,"collapse,trim,uncomment,upcase")
907 $ IF ans.EQS."" THEN ans = dflt
908 $ tzhour   = F$ELEMENT(0,":","''ans'") !first
909 $ IF tzhour.EQS."" THEN tzhour = 0
910 $ tzhour   = F$INTEGER(tzhour)
911 $ tzminrem = F$ELEMENT(1,":","''ans'") !second
912 $ IF tzminrem.NES."" 
913 $ THEN 
914 $   tzminrem = F$INTEGER(tzminrem)
915 $   IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
916 $ ELSE 
917 $   tzminrem = 0
918 $ ENDIF
919 $ tzmins = tzhour*60 + tzminrem
920 $ tzd = F$STRING(tzmins*60)
921 $ IF tzhour .GE. 0 
922 $ THEN
923 $   signothetime = "+" 
924 $ ELSE
925 $   tzhour = -1*tzhour       !keeps !UL happy
926 $   signothetime = "-"
927 $ ENDIF
928 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
929 $ THEN
930 $   echo ""
931 $   echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
932 $   goto TZSet
933 $ ENDIF
934 $!
935 $Beyond_TimeZone:
936 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
937 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
938 $!
939 $!: determine the architecture name  
940 $! genconfig.pl has either archname='VMS_AXP' or 'VMS_VAX'
941 $! Note that DCL in VMS V5.4 does not have F$GETSYI("ARCH_NAME")
942 $! but does have F$GETSYI("HW_MODEL").
943 $!
944 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
945 $ THEN 
946 $   archname = "VMS_VAX"
947 $   otherarch = "an Alpha"
948 $   alignbytes="8"
949 $   arch_type = "ARCH-TYPE=__VAX__"
950 $ ELSE
951 $   archname = "VMS_AXP"
952 $   otherarch = "a VAX"
953 $   alignbytes="8"
954 $   arch_type = "ARCH-TYPE=__AXP__"
955 $ ENDIF
956 $ rp = "What is your architecture name? [''archname'] "
957 $ GOSUB myread
958 $ IF ans.NES.""
959 $ THEN
960 $   ans = F$EDIT(ans,"COLLAPSE, UPCASE")
961 $   IF (ans.NES.archname) !.AND.knowitall
962 $   THEN
963 $     echo4 "I'll go with ''archname' anyway..."
964 $   ENDIF
965 $ ENDIF
966 $ dflt = "n"
967 $ vms_prefix = "perl_root"
968 $ vms_prefixup = F$EDIT(vms_prefix,"UPCASE")
969 $ rp = "Will you be sharing your ''vms_prefixup' with ''otherarch'? [''dflt'] "
970 $ GOSUB myread
971 $ if ans.NES.""
972 $ THEN
973 $   ans = F$EXTRACT(0,1,F$EDIT(ans,"COLLAPSE, UPCASE"))
974 $ ENDIF
975 $ IF (ans.NES."Y")
976 $ THEN
977 $   sharedperl = "N"
978 $ ELSE
979 $   sharedperl = "Y"
980 $   IF (archname.EQS."VMS_AXP")
981 $   THEN
982 $     macros = macros + """AXE=1"","
983 $   ENDIF
984 $ ENDIF
985 $!
986 $!: is AFS running?                       !sfn
987 $!: decide how portable to be.  Allow command line overrides. !sfn
988 $!: set up shell script to do ~ expansion !sfn
989 $!: expand filename                       !sfn
990 $!: now set up to get a file name         !sfn
991 $!
992 $ IF F$TYPE(prefix) .EQS. ""
993 $ THEN
994 $   prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
995 $   prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - ".;"
996 $   prefixbase = prefix - "]"
997 $   prefix = prefixbase + ".]"
998 $ ENDIF
999 $ src = prefix
1000 $!: determine root of directory hierarchy where package will be installed.
1001 $ dflt = prefix
1002 $ IF .NOT.silent 
1003 $ THEN 
1004 $   echo ""
1005 $   echo "By default, ''package' will be installed in ''dflt', pod"
1006 $   echo "pages under ''prefixbase'.LIB.POD], etc..., i.e. with ''dflt' as prefix for"
1007 $   echo "all installation directories."
1008 $   echo "On ''osname' the prefix is used to DEFINE the ''vms_prefixup' prior to installation"
1009 $   echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
1010 $ ENDIF
1011 $ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
1012 $ GOSUB myread
1013 $ IF ans.NES.""
1014 $ THEN 
1015 $   prefix = ans
1016 $   IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
1017 $ ELSE 
1018 $   prefix = dflt
1019 $ ENDIF
1020 $ perl_root = prefix
1021 $!
1022 $! Check here for pre-existing PERL_ROOT.
1023 $!  -> ask if removal desired.
1024 $! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
1025 $!  -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
1026 $!
1027 $ vms_skip_install = "true"
1028 $ dflt = "y"
1029 $! echo ""
1030 $ rp = "Skip the remaining """"where install"""" questions? [''dflt'] "
1031 $ GOSUB myread
1032 $ IF (.NOT.ans).AND.(ans.NES."") THEN vms_skip_install = "false"
1033 $ IF (.NOT.vms_skip_install)
1034 $ THEN
1035 $!
1036 $!: set the prefixit variable, to compute a suitable default value
1037 $!
1038 $!: determine where private library files go
1039 $!: Usual default is /usr/local/lib/perl5.  Also allow things like 
1040 $!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
1041 $   IF .NOT.silent 
1042 $   THEN TYPE SYS$INPUT:
1043
1044 There are some auxiliary files for perl5 that need to be put into a
1045 private library directory that is accessible by everyone.
1046 $   ENDIF
1047 $   IF F$TYPE(privlib) .NES. ""
1048 $   THEN dflt = privlib
1049 $   ELSE dflt = "''vms_prefix':[lib]"
1050 $   ENDIF
1051 $   rp = "Pathname where the private library files will reside? " 
1052 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1053 $   GOSUB myread
1054 $   IF ans.NES.""
1055 $   THEN privlib = ans
1056 $   ELSE privlib = dflt
1057 $   ENDIF
1058 $!
1059 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
1060 $!
1061 $ perl_symbol = "true"
1062 $ perl_verb = ""
1063 $ dflt = "y"
1064 $ IF .NOT.silent 
1065 $ THEN 
1066 $   echo ""
1067 $   echo "You may choose to write ''packageup'_SETUP.COM to assign a foreign"
1068 $   echo "symbol to invoke ''package', which is the usual method."
1069 $   echO "If you do not do so then you would need a DCL command verb at the"
1070 $   echo "process or the system wide level."
1071 $ ENDIF
1072 $ rp = "Invoke perl as a global symbol foreign command? [''dflt'] "
1073 $ GOSUB myread
1074 $ IF (.NOT.ans).AND.(ans.NES."") THEN perl_symbol = "false"
1075 $!
1076 $ IF (.NOT.perl_symbol)
1077 $ THEN
1078 $   dflt = "y"
1079 $   IF .NOT.silent 
1080 $   THEN 
1081 $     echo ""
1082 $     echo "Since you won't be using a symbol you must choose to put the ''packageup'"
1083 $     echo "verb in a per-process table or in the system wide DCLTABLES (which"
1084 $     echo "would require write privilege)."
1085 $   ENDIF
1086 $   rp = "Invoke perl as a per process command verb? [ ''dflt' ] "
1087 $   GOSUB myread
1088 $   IF (.NOT.ans).AND.(ans.NES."")
1089 $   THEN perl_verb = "DCLTABLES"
1090 $   ELSE perl_verb = "PROCESS"
1091 $   ENDIF
1092 $ ENDIF ! (.NOT.perl_symbol)
1093 $!
1094 $!: set the base revision
1095 $ baserev="5.0"
1096 $ revision = baserev - ".0"
1097 $!: get the patchlevel
1098 $ echo ""
1099 $ echo4 "Getting the current patchlevel..."
1100 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1101 $ IF (patchlevel_h.NES."")
1102 $ THEN
1103 $   got_patch = "false"
1104 $   got_sub   = "false"
1105 $   got_api_revision   = "false"
1106 $   got_api_version    = "false"
1107 $   got_api_subversion = "false"
1108 $   OPEN/READONLY CONFIG 'patchlevel_h' 
1109 $Patchlevel_h_loop:
1110 $   READ/END_Of_File=Close_patch/ERROR=Close_patch CONFIG line
1111 $   IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1112 $   THEN
1113 $     line = F$EDIT(line,"COMPRESS, TRIM")
1114 $     patchlevel = F$ELEMENT(2," ",line)
1115 $     got_patch = "true"
1116 $   ENDIF
1117 $   IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1118 $   THEN
1119 $     line = F$EDIT(line,"COMPRESS, TRIM")
1120 $     subversion = F$ELEMENT(2," ",line)
1121 $     got_sub = "true"
1122 $   ENDIF
1123 $   IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1124 $   THEN
1125 $     line = F$EDIT(line,"COMPRESS, TRIM")
1126 $     api_revision = F$ELEMENT(2," ",line)
1127 $     got_api_revision = "true"
1128 $   ENDIF
1129 $   IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1130 $   THEN
1131 $     line = F$EDIT(line,"COMPRESS, TRIM")
1132 $     api_version = F$ELEMENT(2," ",line)
1133 $     got_api_version = "true"
1134 $   ENDIF
1135 $   IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1136 $   THEN
1137 $     line = F$EDIT(line,"COMPRESS, TRIM")
1138 $     api_subversion = F$ELEMENT(2," ",line)
1139 $     got_api_subversion = "true"
1140 $   ENDIF
1141 $   IF (.NOT.got_patch).OR.(.NOT.got_sub) THEN GOTO Patchlevel_h_loop
1142 $Close_patch:
1143 $   CLOSE CONFIG
1144 $ ELSE
1145 $   patchlevel="0"
1146 $   subversion="0"
1147 $ ENDIF
1148 $ IF (F$STRING(subversion) .NES. "0")
1149 $ THEN
1150 $   echo "(You have ''package' revision ''revision' patchlevel ''patchlevel' subversion ''subversion'.)"
1151 $ ELSE
1152 $   echo "(You have ''package' revision ''revision' patchlevel ''patchlevel'.)"
1153 $ ENDIF
1154 $!
1155 $ version = revision + "_" + patchlevel + "_" + subversion
1156 $!
1157 $ IF (.NOT.vms_skip_install)
1158 $ THEN
1159 $!: set the prefixup variable, to restore leading tilde escape !sfn
1160 $!
1161 $!: determine where public architecture dependent libraries go
1162 $   IF (.NOT.silent) 
1163 $   THEN 
1164 $     echo ""
1165 $     echo "''package' contains architecture-dependent library files.  If you are"
1166 $   ENDIF
1167 $   IF (.NOT.silent) 
1168 $   THEN TYPE SYS$INPUT:
1169 sharing libraries in a heterogeneous environment, you might store
1170 these files in a separate location.  Otherwise, you can just include
1171 them with the rest of the public library files.
1172 $   ENDIF
1173 $   IF F$TYPE(archlib) .NES. ""
1174 $   THEN dflt = archlib
1175 $   ELSE dflt = privlib - "]" + "." + archname + "." + version + "]"
1176 $   ENDIF
1177 $   rp = "Where do you want to put the public architecture-dependent libraries? "
1178 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1179 $   GOSUB myread
1180 $   IF ans.NES.""
1181 $   THEN archlib = ans
1182 $   ELSE archlib = dflt
1183 $   ENDIF
1184 $!
1185 $ ENDIF !%Config-I-VMS, skip "where install" questions
1186 $!
1187 $! This quotation from Configure has to be included on VMS:
1188 $!
1189 $ TYPE SYS$INPUT:
1190
1191 There is, however, a strange, musty smell in the air that reminds me of
1192 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
1193 $ CONTINUE
1194 $ IF (.NOT.vms_skip_install)
1195 $ THEN
1196 $!: it so happens the Eunice I know will not run shell scripts in Unix format
1197 $!
1198 $!: see if setuid scripts can be secure           !sfn
1199 $!: now see if they want to do setuid emulation   !sfn
1200 $!
1201 $!: determine where site specific libraries go.
1202 $   IF .NOT.silent 
1203 $   THEN TYPE SYS$INPUT:
1204
1205 The installation process will also create a directory for
1206 site-specific extensions and modules.  Some users find it convenient
1207 to place all local files in this directory rather than in the main
1208 distribution directory.
1209 $   ENDIF
1210 $   IF F$TYPE(sitelib) .NES. ""
1211 $   THEN dflt = sitelib
1212 $   ELSE dflt = privlib - "]" + ".SITE_PERL]"
1213 $   ENDIF
1214 $   rp = "Pathname for the site-specific library files? "
1215 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1216 $   GOSUB myread
1217 $   IF ans.NES.""
1218 $   THEN sitelib = ans
1219 $   ELSE sitelib = dflt
1220 $   ENDIF
1221 $!
1222 $!: determine where site specific architecture-dependent libraries go.
1223 $   IF .NOT.silent 
1224 $   THEN TYPE SYS$INPUT:
1225
1226 The installation process will also create a directory for
1227 architecture-dependent site-specific extensions and modules.
1228 $   ENDIF
1229 $   IF F$TYPE(sitearch) .NES. ""
1230 $   THEN dflt = sitearch
1231 $   ELSE dflt = sitelib - "]" + "." + archname + "]"
1232 $   ENDIF
1233 $   rp = "Pathname for the site-specific architecture-dependent library files? "
1234 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1235 $   GOSUB myread
1236 $   IF ans.NES.""
1237 $   THEN sitearch = ans
1238 $   ELSE sitearch = dflt
1239 $   ENDIF
1240 $!
1241 $!: determine where old public architecture dependent libraries might be
1242 $!
1243 $!: determine where public executables go
1244 $   IF F$TYPE(bin) .NES. ""
1245 $   THEN dflt = bin
1246 $!   ELSE dflt = prefix - ".]" + ".BIN]"
1247 $   ELSE dflt = "/''vms_prefix'/000000"
1248 $   ENDIF
1249 $   rp = "Pathname where the public executables will reside? "
1250 $   rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
1251 $   GOSUB myread
1252 $   IF ans.NES.""
1253 $   THEN bin = ans
1254 $   ELSE bin = dflt
1255 $   ENDIF
1256 $!
1257 $!: determine where manual pages are on this system
1258 $!: What suffix to use on installed man pages
1259 $!: see if we can have long filenames
1260 $!: determine where library module manual pages go
1261 $!: What suffix to use on installed man pages
1262 $!: see what memory models we can support
1263 $!
1264 $ ELSE ! skipping "where install" questions, we must set some symbols
1265 $   IF F$TYPE(archlib).EQS."" THEN -
1266       archlib="''vms_prefix':[lib.''archname'.''version']"
1267 $   IF F$TYPE(bin) .EQS. "" THEN -
1268       bin="/''vms_prefix'/000000"
1269 $   IF F$TYPE(privlib) .EQS. "" THEN -
1270       privlib ="''vms_prefix':[lib]"
1271 $   IF F$TYPE(sitearch) .EQS. "" THEN -
1272       sitearch="''vms_prefix':[lib.site_perl.''archname']"
1273 $   IF F$TYPE(sitelib) .EQS. "" THEN -
1274       sitelib ="''vms_prefix':[lib.site_perl]"
1275 $ ENDIF !%Config-I-VMS, skip "where install" questions
1276 $!
1277 $! These derived locations can be set whether we've opted to
1278 $! skip the where install questions or not.
1279 $!
1280 $ IF F$TYPE(archlibexp) .EQS. "" THEN -
1281     archlibexp="''vms_prefix':[lib.''archname'.''version']"
1282 $ IF F$TYPE(binexp) .EQS. "" THEN -
1283     binexp ="''vms_prefix':[000000]"
1284 $ IF F$TYPE(builddir) .EQS. "" THEN -
1285     builddir ="''vms_prefix':[000000]"
1286 $ IF F$TYPE(installarchlib) .EQS. "" THEN -
1287     installarchlib="''vms_prefix':[lib.''archname'.''version']"
1288 $ IF F$TYPE(installbin) .EQS. "" THEN -
1289     installbin ="''vms_prefix':[000000]"
1290 $ IF F$TYPE(installscript) .EQS. "" THEN -
1291     installscript ="''vms_prefix':[utils]"
1292 $ IF F$TYPE(installman1dir) .EQS. "" THEN -
1293     installman1dir ="''vms_prefix':[man.man1]"
1294 $ IF F$TYPE(installman3dir) .EQS. "" THEN -
1295     installman3dir ="''vms_prefix':[man.man3]"
1296 $ IF F$TYPE(installprivlib) .EQS. "" THEN -
1297     installprivlib ="''vms_prefix':[lib]"
1298 $ IF F$TYPE(installsitearch) .EQS. "" THEN -
1299     installsitearch="''vms_prefix':[lib.site_perl.''archname']"
1300 $ IF F$TYPE(installsitelib) .EQS. "" THEN -
1301     installsitelib ="''vms_prefix':[lib.site_perl]"
1302 $ IF F$TYPE(oldarchlib) .EQS. "" THEN -
1303     oldarchlib="''vms_prefix':[lib.''archname']"
1304 $ IF F$TYPE(oldarchlibexp) .EQS. "" THEN -
1305     oldarchlibexp="''vms_prefix':[lib.''archname']"
1306 $ IF F$TYPE(privlibexp) .EQS. "" THEN -
1307     privlibexp ="''vms_prefix':[lib]"
1308 $ IF F$TYPE(sitearchexp) .EQS. "" THEN -
1309     sitearchexp ="''vms_prefix':[lib.site_perl.''archname']"
1310 $ IF F$TYPE(sitelib_stem) .EQS. "" THEN -
1311     sitelib_stem ="''vms_prefix':[lib.site_perl]"
1312 $ IF F$TYPE(sitelibexp) .EQS. "" THEN -
1313     sitelibexp ="''vms_prefix':[lib.site_perl]"
1314 $!
1315 $!: see if we need a special compiler
1316 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1317 $!
1318 $ nocc = "f"
1319 $ vms_cc_dflt = ""
1320 $ vms_cc_available = ""
1321 $!
1322 $ OPEN/WRITE CONFIG ccvms.c
1323 $ WRITE CONFIG "#ifdef __DECC"
1324 $ WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
1325 $ WRITE CONFIG "#endif"
1326 $ WRITE CONFIG "#include <stdio.h>"
1327 $ WRITE CONFIG "int main() {"
1328 $ WRITE CONFIG "#ifdef __DECC"
1329 $ WRITE CONFIG "        printf(""/DECC\n"");"
1330 $ WRITE CONFIG "#else"
1331 $ WRITE CONFIG "        printf(""/VAXC\n"");"
1332 $ WRITE CONFIG "#endif"
1333 $ WRITE CONFIG "        exit(0);"
1334 $ WRITE CONFIG "}"
1335 $ CLOSE CONFIG
1336 $!
1337 $! DEFINE SYS$ERROR _NLA0:
1338 $! DEFINE SYS$OUTPUT _NLA0:
1339 $ cc/NoObj/list=ccvms.lis ccvms.c
1340 $ tmp = $status
1341 $! DEASSIGN SYS$OUTPUT
1342 $! DEASSIGN SYS$ERROR
1343 $ IF (silent) THEN GOSUB Shut_up
1344 $ IF tmp.NE.%X10B90001
1345 $ THEN 
1346 $  IF tmp.NE.%X10000001
1347 $  THEN 
1348 $    nocc = "t"  !%X10000001 is return from gcc
1349 $    GOTO Gcc_initial_check
1350 $  ENDIF
1351 $ ENDIF
1352 $!
1353 $ GOSUB List_Parse
1354 $ IF .NOT.silent THEN echo ""
1355 $ echo "Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'" 
1356 $ IF F$LOCATE("VAX",line).NE.F$LENGTH(line) 
1357 $ THEN 
1358 $   IF .NOT.silent
1359 $   THEN 
1360 $     echo "Will try cc/decc..."
1361 $   ENDIF
1362 $   DEFINE/USER_MODE SYS$ERROR NL:
1363 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1364 $   SET NOON
1365 $   cc/decc/NoObj/list=ccvms.lis ccvms.c
1366 $   tmp = $status
1367 $   SET ON
1368 $   IF (silent) THEN GOSUB Shut_up
1369 $   IF tmp.NE.%X10B90001
1370 $   THEN
1371 $     echo "Apparently you don't have that one."
1372 $   ELSE
1373 $     GOSUB List_parse
1374 $     echo "You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1375 $     vms_cc_available = vms_cc_available + "cc/decc "
1376 $   ENDIF
1377 $ ELSE
1378 $   IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
1379 $   THEN 
1380 $     vms_cc_dflt = "/decc"
1381 $     vms_cc_available = vms_cc_available + "cc/decc "
1382 $   ENDIF
1383 $ ENDIF
1384 $!
1385 $Gcc_initial_check:
1386 $ echo "Checking for gcc"
1387 $ OPEN/WRITE CONFIG gccvers.lis
1388 $ DEFINE/USER_MODE SYS$ERROR CONFIG
1389 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1390 $ 'gcc_symbol'/noobj/version _nla0:
1391 $ tmp = $status
1392 $ IF (silent) THEN GOSUB Shut_up
1393 $ CLOSE CONFIG
1394 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1395 $ THEN
1396 $   echo "Symbol ""''gcc_symbol'"" is not defined. I guess you don't have it."
1397 $   DELETE/NOLOG/NOCONFIRM gccvers.lis;
1398 $   GOTO Cxx_initial_check
1399 $ ENDIF
1400 $ OPEN/READ CONFIG gccvers.lis
1401 $GCC_List_Read:
1402 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1403 $ GOTO GCC_List_Read
1404 $GCC_List_End:
1405 $ CLOSE CONFIG
1406 $ echo line
1407 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1408 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1409 $!
1410 $Cxx_initial_check:
1411 $!
1412 $! Do note that [vms]perl source files have a ways to go before they will 
1413 $! compile under CXX.
1414 $! In order to test Configure.com with CXX swap the '!' comment character 
1415 $! between the following two lines.  
1416 $!
1417 $! IF 1 .eq. 1
1418 $ IF 1 .eq. 0
1419 $!
1420 $ THEN
1421 $!
1422 $ echo "Checking for CXX..."
1423 $ OPEN/WRITE CONFIG ccvms.c
1424 $ WRITE CONFIG "#include <iostream>"
1425 $ WRITE CONFIG "int main() {"
1426 $ WRITE CONFIG "#ifdef __DECCXX"
1427 $ WRITE CONFIG "        cout << __DECCXX, endl;"
1428 $ WRITE CONFIG "#else"
1429 $ WRITE CONFIG "        cout << 0,endl;"
1430 $ WRITE CONFIG "#endif"
1431 $! Todo: add G++ identifier check ??
1432 $ WRITE CONFIG "        return(0);"
1433 $ WRITE CONFIG "}"
1434 $ CLOSE CONFIG
1435 $ SET NOON
1436 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1437 $ DEFINE/USER_MODE SYS$ERROR NL:
1438 $ cxx ccvms.c
1439 $ tmp = $status
1440 $ SET ON
1441 $! success $status with:
1442 $! DEC C++ V1.1-001 on VMS VAX V5.5-2
1443 $! DEC C++ V5.6-013 on OpenVMS VAX V7.1
1444 $! DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1445 $! Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1446 $ IF tmp .eq. %X15F60001  
1447 $ THEN
1448 $! Which linker?
1449 $   SET NOON
1450 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1451 $   DEFINE/USER_MODE SYS$ERROR NL:
1452 $   link ccvms.obj
1453 $   tmp = $status
1454 $   SET ON
1455 $   ! success $status with:
1456 $   ! link && DEC C++ V1.1-001 on VMS VAX V5.5-2
1457 $   ! link && DEC C++ V5.6-013 on OpenVMS VAX V7.1
1458 $   IF tmp .eq. %X10000001
1459 $   THEN
1460 $     ld_try = "Link"
1461 $     vms_cc_available = vms_cc_available + "cxx "
1462 $     echo "CXX and LINK are available."
1463 $   ELSE
1464 $     IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1465 $     SET NOON
1466 $     DEFINE/USER_MODE SYS$OUTPUT NL:
1467 $     DEFINE/USER_MODE SYS$ERROR NL:
1468 $     cxxlink ccvms.obj
1469 $     tmp = $status
1470 $     SET ON
1471 $     ! success $status with:
1472 $     ! cxxlink && DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1473 $     ! cxxlink && Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1474 $     IF tmp .eq. %X10000001 
1475 $     THEN 
1476 $       ld_try = "cxxlink"
1477 $       vms_cc_available = vms_cc_available + "cxx "
1478 $       echo "CXX and CXXLINK are available."
1479 $     ENDIF
1480 $   ENDIF
1481 $   IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1482 $ ELSE
1483 $   echo "Nope."
1484 $ ENDIF
1485 $ DELETE/NOLOG/NOCONFIRM ccvms.c;
1486 $ IF F$SEARCH("ccvms.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.obj;
1487 $ CALL Cxx_demangler_cleanup
1488 $!
1489 $ ENDIF ! 1 .eq. 0 or 1 .eq. 1
1490 $!
1491 $CC_Cleanup:
1492 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1493 $CC_Desired:
1494 $!: see if we need a special compiler
1495 $! echo ""
1496 $ echo "Available compiler(s):"
1497 $ echo "( ''vms_cc_available')"
1498 $ IF .NOT.nocc 
1499 $ THEN
1500 $   dflt = "cc''vms_cc_dflt'"  !-> "cc" in case first compile went OK
1501 $ ELSE
1502 $   dflt = gcc_symbol
1503 $ ENDIF
1504 $ rp = "Use which C compiler? [''dflt'] "
1505 $ GOSUB myread
1506 $ IF ans.NES.""
1507 $ THEN
1508 $   ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1509 $   Mcc = ans
1510 $   IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
1511 $   THEN
1512 $     Mcc = "cc/decc"
1513 $     Using_Dec_C := Y
1514 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1515 $   ENDIF
1516 $   IF F$LOCATE("cxx",F$EDIT(ans,"COLLAPSE,LOWERCASE")) .NE. F$LENGTH(ans)
1517 $   THEN
1518 $     Mcc = "cxx"
1519 $     using_cxx := Y
1520 $     ld = ld_try
1521 $!     C_COMPILER_Replace = "CC=cc=''Mcc'"
1522 $   ENDIF
1523 $   IF Mcc.NES.dflt
1524 $   THEN
1525 $     IF F$LOCATE("dec",dflt) .NE. F$LENGTH(dflt) .or. -
1526          F$LOCATE("compaq",dflt) .NE. F$LENGTH(dflt)
1527 $     THEN 
1528 $       C_COMPILER_Replace = "CC=cc=''Mcc'"
1529 $     ELSE
1530 $       Using_Dec_C := Y
1531 $     ENDIF
1532 $   ELSE
1533 $     IF Mcc .EQS. "cc/decc"
1534 $     THEN
1535 $       Using_Dec_C := Y
1536 $       C_COMPILER_Replace = "CC=cc=''Mcc'"
1537 $     ENDIF
1538 $   ENDIF
1539 $ ELSE 
1540 $   Mcc = dflt
1541 $   IF Mcc .EQS. "cc/decc"
1542 $   THEN
1543 $     Using_Dec_C := Y
1544 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1545 $   ENDIF
1546 $   IF Mcc .EQS. "gcc"
1547 $   THEN
1548 $     Using_Gnu_C := Y
1549 $     C_COMPILER_Replace = "CC=cc=''Mcc'"
1550 $   ENDIF
1551 $ ENDIF
1552 $Decc_Version_check:
1553 $ ccversion=""
1554 $ IF Using_Dec_C
1555 $ THEN
1556 $   echo ""
1557 $   echo4 "Checking for Dec C's version number..."
1558 $   OPEN/WRITE CONFIG deccvers.c
1559 $   WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
1560 $   WRITE CONFIG "#include <stdio.h>"
1561 $   WRITE CONFIG "int main() {"
1562 $   WRITE CONFIG "#ifdef __DECC"
1563 $   WRITE CONFIG "#ifdef __DECC_VER"
1564 $   WRITE CONFIG "        printf(""%i\n"", __DECC_VER);"
1565 $   WRITE CONFIG "#else"
1566 $   WRITE CONFIG "        printf(""%i\n"", ""1"");"
1567 $   WRITE CONFIG "#endif"
1568 $   WRITE CONFIG "#endif"
1569 $   WRITE CONFIG "        exit(0);"
1570 $   WRITE CONFIG "}"
1571 $   CLOSE CONFIG
1572 $   SET NOON
1573 $   DEFINE/USER_MODE SYS$ERROR NL:
1574 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1575 $   'Mcc' deccvers.c
1576 $   tmp = $status
1577 $   IF (silent) THEN GOSUB Shut_up
1578 $   DEFINE/USER_MODE SYS$ERROR NL:
1579 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1580 $   link deccvers.obj
1581 $   tmp = $status
1582 $   IF (silent) THEN GOSUB Shut_up
1583 $   OPEN/WRITE CONFIG deccvers.out
1584 $   DEFINE/USER_MODE SYS$ERROR CONFIG
1585 $   DEFINE/USER_MODE SYS$OUTPUT CONFIG
1586 $   mcr []deccvers.exe
1587 $   tmp = $status
1588 $   SET ON
1589 $   CLOSE CONFIG
1590 $   IF (silent) THEN GOSUB Shut_up
1591 $   OPEN/READ CONFIG deccvers.out
1592 $   READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1593 $Dec_c_cleanup:
1594 $   CLOSE CONFIG
1595 $   echo "You are using Dec C ''line'"
1596 $   ccversion = line
1597 $   Dec_C_Version = F$INTEGER(line)
1598 $   IF Dec_C_Version .GE. 60200000
1599 $   THEN
1600 $     echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
1601 $     ccflags = ccflags + "/NOANSI_ALIAS"
1602 $   ENDIF
1603 $   DELETE/NOLOG/NOCONFIRM deccvers.*;
1604 $ ENDIF
1605 $Gcc_check:
1606 $ gccversion = ""
1607 $ IF Using_Gnu_C
1608 $ THEN
1609 $   vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1610 $   vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1611 $   gcclib_olb  = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1612 $   IF gcclib_olb .EQS. "" 
1613 $   THEN 
1614 $!    These objects/libs come w/ gcc 2.7.2 for AXP:
1615 $     tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1616 $     IF tmp .NES. "" then gcclib_olb = tmp
1617 $     tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1618 $     IF tmp .NES. "" 
1619 $     THEN 
1620 $       IF gcclib_olb .EQS. "" 
1621 $       THEN gcclib_olb = tmp
1622 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1623 $       ENDIF
1624 $     ENDIF
1625 $     tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1626 $     IF tmp .NES. "" 
1627 $     THEN 
1628 $       IF gcclib_olb .EQS. "" 
1629 $       THEN gcclib_olb = tmp
1630 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1631 $       ENDIF
1632 $     ENDIF
1633 $     tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1634 $     IF tmp .NES. "" 
1635 $     THEN 
1636 $       IF gcclib_olb .EQS. "" 
1637 $       THEN gcclib_olb = tmp
1638 $       ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1639 $       ENDIF
1640 $     ENDIF
1641 $     IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1642 $   ELSE
1643 $     gcclib_olb = gcclib_olb + "/lib"
1644 $   ENDIF
1645 $   IF   gcclib_olb .NES. "" .AND. -
1646      (vaxcrtl_olb .NES. "" .OR. -
1647       vaxcrtl_exe .NES. "" )
1648 $   THEN
1649 $     echo ""
1650 $     echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1651 $     OPEN/WRITE CONFIG gccvers.c
1652 $!     WRITE CONFIG "#include <stdlib.h>"  !DECC is sooo picky
1653 $     WRITE CONFIG "#include <stdio.h>"
1654 $     WRITE CONFIG "int main() {"
1655 $     WRITE CONFIG "#ifdef __GNUC__"
1656 $     WRITE CONFIG "#ifdef __VERSION__"
1657 $     WRITE CONFIG "        printf(""%s\n"", __VERSION__);"
1658 $     WRITE CONFIG "#else"
1659 $     WRITE CONFIG "        printf(""%s\n"", ""1"");"
1660 $     WRITE CONFIG "#endif"
1661 $     WRITE CONFIG "#endif"
1662 $     WRITE CONFIG "        exit(0);"
1663 $     WRITE CONFIG "}"
1664 $     CLOSE CONFIG
1665 $     DEFINE SYS$ERROR _NLA0:
1666 $     DEFINE SYS$OUTPUT _NLA0:
1667 $     'Mcc' gccvers.c
1668 $     tmp = $status
1669 $     DEASSIGN SYS$ERROR _NLA0:
1670 $     DEASSIGN SYS$OUTPUT _NLA0:
1671 $     IF (silent) THEN GOSUB Shut_up
1672 $     DEFINE SYS$ERROR _NLA0:
1673 $     DEFINE SYS$OUTPUT _NLA0:
1674 $     IF vaxcrtl_exe .EQS. ""
1675 $     THEN 
1676 $       IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1677 $       THEN 
1678 $         link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1679 $         tmp = $status
1680 $       ELSE
1681 $         link gccvers.obj,'gcclib_olb'
1682 $         tmp = $status
1683 $       ENDIF
1684 $     ELSE
1685 $       OPEN/WRITE CONFIG GCCVERS.OPT
1686 $       WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1687 $       CLOSE CONFIG
1688 $       link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1689 $       tmp = $status
1690 $     ENDIF
1691 $     DEASSIGN SYS$ERROR
1692 $     DEASSIGN SYS$OUTPUT
1693 $     IF (silent) THEN GOSUB Shut_up
1694 $     OPEN/WRITE CONFIG gccvers.out
1695 $     DEFINE SYS$ERROR CONFIG
1696 $     DEFINE SYS$OUTPUT CONFIG
1697 $     mcr []gccvers.exe
1698 $     tmp = $status
1699 $     CLOSE CONFIG
1700 $     DEASSIGN SYS$OUTPUT
1701 $     DEASSIGN SYS$ERROR
1702 $     IF (silent) THEN GOSUB Shut_up
1703 $     OPEN/READ CONFIG gccvers.out
1704 $     READ/END_OF_FILE=Gcc_cleanup CONFIG line
1705 $Gcc_cleanup:
1706 $     CLOSE CONFIG
1707 $     DELETE/NOLOG/NOCONFIRM gccvers.*;
1708 $     IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1709 $     THEN 
1710 $       echo "You are not using GNU cc."
1711 $       GOTO Host_name
1712 $     ELSE 
1713 $       echo "You are using GNU cc ''line'"
1714 $       gccversion = line
1715 $       Using_Gnu_C := Y
1716 $       C_COMPILER_Replace = "CC=cc=''Mcc'"
1717 $       GOTO Include_dirs
1718 $     ENDIF
1719 $   ENDIF
1720 $ ENDIF
1721 $Cxx_Version_check:
1722 $ IF using_cxx
1723 $ THEN
1724 $   OPEN/WRITE CONFIG cxxvers.c
1725 $   WRITE CONFIG "#include <stdio.h>"
1726 $   WRITE CONFIG "int main() {"
1727 $   WRITE CONFIG "#ifdef __DECCXX_VER"
1728 $   WRITE CONFIG "        printf(""%i\n"", __DECCXX_VER);"
1729 $   WRITE CONFIG "#else"
1730 $   WRITE CONFIG "        printf(""%i\n"", ""0"");"
1731 $   WRITE CONFIG "#endif"
1732 $   WRITE CONFIG "        return(0);"
1733 $   WRITE CONFIG "}"
1734 $   CLOSE CONFIG
1735 $   SET NOON
1736 $   DEFINE/USER_MODE SYS$ERROR NL:
1737 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1738 $   'Mcc' cxxvers.c
1739 $   tmp = $status
1740 $   SET ON
1741 $   IF (silent) THEN GOSUB Shut_up
1742 $   SET NOON
1743 $   DEFINE/USER_MODE SYS$ERROR NL:
1744 $   DEFINE/USER_MODE SYS$OUTPUT NL:
1745 $   'ld' cxxvers.obj
1746 $   tmp = $status
1747 $   SET ON
1748 $   IF (silent) THEN GOSUB Shut_up
1749 $   OPEN/WRITE CONFIG cxxvers.out
1750 $   SET NOON
1751 $   DEFINE/USER_MODE SYS$ERROR CONFIG
1752 $   DEFINE/USER_MODE SYS$OUTPUT CONFIG
1753 $   mcr []cxxvers.exe
1754 $   tmp = $status
1755 $   SET ON
1756 $   CLOSE CONFIG
1757 $   IF (silent) THEN GOSUB Shut_up
1758 $   OPEN/READ CONFIG cxxvers.out
1759 $   READ/END_OF_FILE=Cxx_cleanup CONFIG line
1760 $Cxx_cleanup:
1761 $   CLOSE CONFIG
1762 $   DELETE/NOLOG/NOCONFIRM cxxvers.*;
1763 $   echo "You are using CXX ''line'"
1764 $   cxxversion = line
1765 $   ccversion = line
1766 $   CALL Cxx_demangler_cleanup
1767 $ ENDIF
1768 $!
1769 $Cxx_demangler_cleanup: SUBROUTINE
1770 $!
1771 $!  If we do build with CXX these demangler Dbs will be left all over.
1772 $!  However, configure.com does try to remove the [.UU] sub directory.
1773 $!  Be sure to set default to the correct place before calling this sub.
1774 $!
1775 $ SET NOON
1776 $ IF F$SEARCH("[.CXX_REPOSITORY]*.*") .NES. "" THEN DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
1777 $ IF F$SEARCH("CXX_REPOSITORY.DIR") .NES. ""
1778 $ THEN
1779 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
1780 $   DELETE/NOLOG/NOCONFIRM CXX_REPOSITORY.DIR;
1781 $ ENDIF
1782 $ SET ON
1783 $ EXIT
1784 $ ENDSUBROUTINE ! Cxx_demangler_cleanup
1785 $!
1786 $ GOTO Host_name
1787 $!
1788 $List_Parse:
1789 $ OPEN/READ CONFIG ccvms.lis
1790 $ READ CONFIG line
1791 $ IF (F$GETSYI("HW_MODEL") .LT. 1024)
1792 $ THEN
1793 $   read CONFIG line
1794 $   archsufx = "VAX"
1795 $ ELSE
1796 $   archsufx = "AXP"
1797 $ ENDIF
1798 $ CLOSE CONFIG
1799 $ line = F$EDIT(line,"TRIM,COMPRESS")
1800 $ line = line - "Page 1"           ! occurs at end all compilers
1801 $ line = line - "CCVMS "           ! filename appears w/ VAXC
1802 $ line = line - "Source Listing "  ! Seen w/ AXP DECC
1803 $ tmp = F$EXTRACT(0,20,line)       !timestamp, e.g. "30-JUL-1996 21:12:54 "
1804 $ line = line - tmp
1805 $ line = F$EDIT(line,"TRIM")       !bit redundant but we're in no big hurry
1806 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1807 $ RETURN
1808 $!
1809 $Include_dirs:
1810 $!: What should the include directory be ? (.TLB text libraries)
1811 $ dflt = gcclib_olb 
1812 $ rp = "Where are the include files you want to use? "
1813 $ IF f$length( rp + "[''dflt'] " ).gt.76
1814 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1815 $ ELSE rp = rp + "[''dflt'] "
1816 $ ENDIF
1817 $ GOSUB myread
1818 $ usrinc = ans
1819 $!
1820 $!: see if we have to deal with yellow pages, now NIS.
1821 $!: now get the host name
1822 $Host_name:
1823 $ echo ""
1824 $ echo4 "Figuring out host name..." !>&4
1825 $ myhostname = ""
1826 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
1827 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
1828 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
1829 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
1830 $  IF myhostname.eqs."".and. -
1831       F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
1832       F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN - 
1833      myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN") 
1834 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
1835 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
1836 $  IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
1837 $  IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
1838 $!: you do not want to know about this
1839 $!: verify guess
1840 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1841 $ GOSUB myread
1842 $ IF (.not.ans).and.(ans.NES."")
1843 $   THEN 
1844 $     READ SYS$COMMAND/PROMPT= - 
1845  "Please type the (one word) name of your host: " ans
1846 $     myhostname = ans
1847 $ ENDIF
1848 $!: translate upper to lower if necessary
1849 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1850 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1851 $ IF mylowhostname.NES.myhostname
1852 $ THEN
1853 $   echo "(Normalizing case in your host name)"
1854 $   myhostname = mylowhostname
1855 $ ENDIF
1856 $!
1857 $ fp = F$LOCATE(".",myhostname)
1858 $ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
1859 $ IF mydomain.NES.""  !no periods in DECnet names like "MYDECNODE::"
1860 $ THEN
1861 $   rp = "What is your domain name? [''mydomain'] "
1862 $   GOSUB myread
1863 $   IF ans .nes. "" THEN mydomain = ans
1864 $!: translate upper to lower if necessary
1865 $   mydomain = F$EDIT(mydomain,"COLLAPSE")
1866 $   mylowdomain = F$EDIT(mydomain," LOWERCASE")
1867 $   IF mylowdomain.NES.mydomain
1868 $   THEN
1869 $     echo "(Normalizing case in your domain name)"
1870 $     mydomain = mylowdomain
1871 $   ENDIF
1872 $ ENDIF
1873 $ myhostname = myhostname - mydomain
1874 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1875 $ IF .NOT.silent 
1876 $ THEN TYPE SYS$INPUT:
1877
1878 I need to get your e-mail address in Internet format if possible, i.e.
1879 something like user@host.domain. Please answer accurately since I have
1880 no easy means to double check it. The default value provided below
1881 is most probably close to the reality but may not be valid from outside
1882 your organization...
1883 $ ENDIF
1884 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1885 $ rp = "What is your e-mail address? [''dflt'] "
1886 $ GOSUB myread
1887 $ IF ans .nes. ""
1888 $ THEN cf_email = ans
1889 $ ELSE cf_email = dflt
1890 $ ENDIF
1891 $!
1892 $ IF .NOT.silent 
1893 $ THEN TYPE SYS$INPUT:
1894
1895 If you or somebody else will be maintaining perl at your site, please
1896 fill in the correct e-mail address here so that they may be contacted
1897 if necessary. Currently, the "perlbug" program included with perl
1898 will send mail to this address in addition to perlbug@perl.com. You may
1899 enter "none" for no administrator.
1900 $ ENDIF
1901 $ dflt = "''cf_email'"
1902 $ rp = "Perl administrator e-mail address [''dflt'] "
1903 $ GOSUB myread
1904 $ IF ans .nes. ""
1905 $ THEN perladmin = ans
1906 $ ELSE perladmin = dflt
1907 $ ENDIF
1908 $!
1909 $!: determine where public executable scripts go
1910 $!: determine perl absolute location
1911 $!: figure out how to guarantee perl startup
1912 $!
1913 $!: see how we invoke the C preprocessor
1914 $! echo ""
1915 $! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1916 $!: Set private lib path
1917 $!: Now check and see which directories actually exist, avoiding duplicates
1918 $!: determine optimize, if desired, or use for debug flag also
1919 $!: We will not override a previous value, but we might want to
1920 $!: augment a hint file
1921 $!: the following weeds options from ccflags that are of no interest to cpp
1922 $!: flags used in final linking phase
1923 $!: Try to guess additional flags to pick up local libraries.
1924 $!: coherency check
1925 $! echo ""
1926 $! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1927 $!: compute shared library extension
1928 $!: Looking for optional libraries
1929 $!: see if nm is to be used to determine whether a symbol is defined or not
1930 $!: get list of predefined functions in a handy place
1931 $!: see if we have sigaction
1932 $!: see whether socketshr exists
1933 $ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
1934 $ THEN
1935 $   Has_socketshr     = "T"
1936 $   echo ""
1937 $   echo4 "Hmm... Looks like you have SOCKETSHR's Berkeley networking support."
1938 $ ELSE
1939 $   Has_socketshr     = "F"
1940 $ ENDIF
1941 $ IF (Dec_C_Version .GE. 50200000)
1942 $ THEN
1943 $   Has_Dec_C_Sockets = "T"
1944 $   echo ""
1945 $   echo4 "Hmm... Looks like you've got Dec C's Berkeley networking support."
1946 $ ELSE
1947 $   Has_Dec_C_Sockets = "F"
1948 $ ENDIF
1949 $ ! Hey, we've got both. Default to Dec C, then, since it's better
1950 $ IF Has_socketshr .OR. Has_Dec_C_Sockets
1951 $ THEN
1952 $   echo ""
1953 $   echo "You've got sockets available. Which socket stack do you want to"
1954 $   echo "build into perl?"
1955 $   IF Has_Dec_C_Sockets
1956 $   THEN
1957 $     dflt = "DECC"
1958 $   else
1959 $     dflt = "SOCKETSHR"
1960 $   endif
1961 $   rp = "Choose socket stack (NONE"
1962 $   IF Has_socketshr THEN rp = rp + ",SOCKETSHR"
1963 $   IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
1964 $   rp = rp + ") [''dflt'] "
1965 $   GOSUB myread
1966 $   IF ans .EQS. "" THEN ans = "''dflt'"
1967 $   Has_Dec_C_Sockets = "F"
1968 $   Has_socketshr = "F"
1969 $   ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1970 $   IF ans.eqs."decc" then Has_Dec_C_Sockets = "T"
1971 $   IF ans.eqs."socketshr" then Has_socketshr = "T"
1972 $ ENDIF
1973 $!
1974 $!
1975 $! Ask if they want to build with VMS_DEBUG perl
1976 $ echo ""
1977 $ echo "Perl can be built to run under the VMS debugger."
1978 $ echo "You should only select this option if you are debugging"
1979 $ echo "perl itself.  This can be a useful feature if you are "
1980 $ echo "embedding perl in a program."
1981 $ dflt = "n"
1982 $ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
1983 $ GOSUB myread
1984 $ IF ans.eqs."" then ans = dflt
1985 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
1986 $ THEN
1987 $   use_vmsdebug_perl = "Y"
1988 $   macros = macros + """__DEBUG__=1"","
1989 $ ELSE
1990 $   use_vmsdebug_perl = "N"
1991 $ ENDIF
1992 $!
1993 $! Ask if they want to build with DEBUGGING
1994 $ echo ""
1995 $ echo "Perl can be built with extra runtime debugging enabled. This
1996 $ echo "enables the -D switch, at the cost of some performance. It
1997 $ echo "was mandatory on perl 5.005 and before on VMS, but is now
1998 $ echo "optional. If you don't generally use it you should probably
1999 $ echo "leave this off and gain a bit of extra speed.
2000 $ dflt = "y"
2001 $ rp = "Build a DEBUGGING version of Perl? [''dflt'] "
2002 $ GOSUB myread
2003 $ IF ans.eqs."" then ans = dflt
2004 $ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
2005 $ THEN
2006 $   use_debugging_perl = "Y"
2007 $ ELSE
2008 $   use_debugging_perl = "N"
2009 $ ENDIF
2010 $!
2011 $! Ask if they want to build with MULTIPLICITY
2012 $ echo ""
2013 $ echo "Perl can be built so that multiple Perl interpreters can coexist"
2014 $ echo "within the same Perl executable."
2015 $ echo "There is some performance overhead, however, so you
2016 $ echo "probably don't want to choose this unless you're going to be doing
2017 $ echo "things with embedded perl."
2018 $ dflt = "n"
2019 $ rp = "Build Perl for multiplicity? [''dflt'] "
2020 $ GOSUB myread
2021 $ IF ans.eqs."" then ans = dflt
2022 $ IF ans
2023 $ THEN
2024 $   usemultiplicity="define"
2025 $ ELSE
2026 $   usemultiplicity="undef"
2027 $ ENDIF
2028 $!
2029 $! Ask if they want to build with 64-bit support
2030 $ IF (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
2031 $ THEN
2032 $   dflt = use64bitint
2033 $   echo ""
2034 $   echo "You can have native 64-bit long integers.
2035 $   echo ""
2036 $   echo "Perl can be built to take advantage of 64-bit integer types
2037 $   echo "on some systems, which provide a much larger range for perl's 
2038 $   echo "mathematical operations.  (Note that does *not* enable 64-bit 
2039 $   echo "fileops at the moment, as Dec C doesn't do that yet)."
2040 $   echo "Choosing this option will most probably introduce binary incompatibilities.
2041 $   echo ""
2042 $   echo "If this doesn't make any sense to you, just accept the default ''dflt'.
2043 $   rp = "Try to use 64-bit integers, if available? [''dflt'] "
2044 $   GOSUB myread
2045 $   IF ans .EQS. "" THEN ans = dflt
2046 $   IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
2047 $   THEN
2048 $     use64bitint="Y"
2049 $   ELSE
2050 $     use64bitint="N"
2051 $   ENDIF
2052 $   IF (use64bitint)
2053 $   THEN
2054 $     dflt = use64bitall
2055 $     echo ""
2056 $     echo "Since you chose 64-bitness you may want to try maximal 64-bitness.
2057 $     echo "What you have chosen is minimal 64-bitness which means just enough
2058 $     echo "to get 64-bit integers.  The maximal means using as much 64-bitness
2059 $     echo "as is possible on the platform.  This in turn means even more binary
2060 $     echo "incompatibilities.  On the other hand, your platform may not have
2061 $     echo "any more maximal 64-bitness than what you already have chosen.
2062 $     echo ""
2063 $     echo "If this doesn't make any sense to you, just accept the default ''dflt'.
2064 $     rp = "Try to use full 64-bit support, if available? [''dflt'] "
2065 $     GOSUB myread
2066 $     IF ans .EQS. "" THEN ans = dflt
2067 $     IF (f$extract(0, 1, f$edit(ans,"COLLAPSE,UPCASE")) .EQS. "Y")
2068 $     THEN
2069 $       use64bitall="Y"
2070 $     ELSE
2071 $       use64bitall="N"
2072 $     ENDIF
2073 $   ENDIF
2074 $ ENDIF ! AXP && >= 7.1
2075 $!
2076 $! Ask about threads, if appropriate
2077 $ if Using_Dec_C
2078 $ THEN
2079 $   echo ""
2080 $   echo "This version of Perl can be built with threads. While really nifty,
2081 $   echo "they are a beta feature, and there is a speed penalty for perl
2082 $   echo "programs if you build with threads *even if you don't use them*
2083 $   dflt = "n"
2084 $   rp = "Build with threads? [''dflt'] "
2085 $   GOSUB myread
2086 $   if ans.eqs."" then ans = dflt
2087 $   if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
2088 $   THEN
2089 $     use_threads="T"
2090 $!
2091 $     ! Shall we do the 5.005-stype threads, or IThreads?
2092 $     echo "As of 5.5.640, Perl has two different internal threading
2093 $     echo "implementations, the 5.005 version (5005threads) and an
2094 $     echo "interpreter-based version (ithreads) that has one
2095 $     echo "interpreter per thread.  Both are very experimental.  This
2096 $     echo "arrangement exists to help developers work out which one
2097 $     echo "is better.
2098 $     echo "
2099 $     echo "If you're a casual user, you probably don't want
2100 $     echo "interpreter-threads at this time.  There doesn't yet exist
2101 $     echo "a way to create threads from within Perl in this model,
2102 $     echo "i.e., ""use Thread;"" will NOT work.
2103 $     echo "
2104 $     dflt = "n"
2105 $     rp = "Build with Interpreter threads? [''dflt']
2106 $     GOSUB myread
2107 $     if ans.eqs."" then ans = dflt
2108 $     if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
2109 $     THEN
2110 $       use_ithreads="Y"
2111 $       use_5005_threads="N"
2112 $     ELSE
2113 $       use_ithreads="N"
2114 $       use_5005_threads="Y"
2115 $     ENDIF
2116 $     ! Are they on VMS 7.1 on an alpha?
2117 $     if (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
2118 $     THEN
2119 $       echo ""
2120 $       echo "Threaded perl can be linked to use multiple kernel threads
2121 $       echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature
2122 $       echo "allows multiple threads to execute simultaneously on an SMP
2123 $       echo "system as well as preventing a single thread from blocking
2124 $       echo "all the threads in a program, even on a single-processor
2125 $       echo "machine. Unfortunately this feature isn't safe on an
2126 $       echo "unpatched 7.1 system. (Several OS patches were required when
2127 $       echo "this procedure was written)
2128 $       dflt = "n"
2129 $       rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
2130 $       gosub myread
2131 $       if ans.eqs."" then ans="''dflt'"
2132 $       if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
2133 $       THEN
2134 $         Thread_Live_Dangerously = "MT=MT=1"
2135 $       ENDIF
2136 $     ENDIF
2137 $   ENDIF
2138 $ ENDIF
2139 $ if archname .eqs. "VMS_AXP"
2140 $ then
2141 $!
2142 $! Case sensitive?
2143 $ echo ""
2144 $ echo "By default, perl (and pretty much everything else on VMS) uses
2145 $ echo "case-insensitive linker symbols. Which is to say, when the
2146 $ echo "underlying C code makes a call to a routine called Perl_foo in
2147 $ echo "the source, the name in the object modules or shareable images
2148 $ echo "is really PERL_FOO. There are some packages that use an
2149 $ echo "embedded perl interpreter that instead require case-sensitive
2150 $ echo "linker symbols.
2151 $ echo ""
2152 $ echo "If you have no idea what this means, and don't have
2153 $ echo "any program requiring anything, choose the default.
2154 $ dflt = be_case_sensitive
2155 $ rp = "Build with case-sensitive symbols? [''dflt'] "
2156 $ gosub myread
2157 $ if ans.eqs."" then ans="''dflt'"
2158 $ be_case_sensitive = "''ans'"
2159 $!
2160 $! IEEE math?
2161 $ echo ""
2162 $ echo "Perl normally uses G_FLOAT format floating point numbers
2163 $ echo "internally, as do most things on VMS. You can, however, build
2164 $ echo "with IEEE floating point numbers instead if you need to.
2165 $ dflt = use_ieee_math
2166 $ rp = "Use IEEE math? [''dflt'] "
2167 $ gosub myread
2168 $ if ans.eqs."" then ans="''dflt'"
2169 $ use_ieee_math = "''ans'"
2170 $ endif
2171 $! CC Flags
2172 $ echo ""
2173 $ echo "You can, if you need to, pass extra flags on to the C
2174 $ echo "compiler.  In general you should only do this if you really,
2175 $ echo "really know what you're doing.
2176 $ dflt = user_c_flags
2177 $ rp = "Extra C flags [''dflt'] "
2178 $ gosub myread
2179 $ if ans.eqs."" then ans="''dflt'"
2180 $ user_c_flags = "''ans'"
2181 $!
2182 $! Ask whether they want to use secure logical translation when tainting
2183 $ echo ""
2184 $ echo "As Perl starts up, it checks several logical names, such as"
2185 $ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
2186 $ echo "of its behavior.  For additional security, you may limit this"
2187 $ echo "process to executive- and kernel-mode translation when tainting"
2188 $ echo "is enabled.  In this case, logical names normally skipped when"
2189 $ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
2190 $ echo "If you do not choose to do this, the usual order of access modes"
2191 $ echo "is used for logical name translation."
2192 $ echo ""
2193 $ echo "This restriction does not apply to the %ENV hash or to implicit"
2194 $ echo "logical name translation during parsing of file specifications;"
2195 $ echo "these always use the normal sequence of access modes for logical"
2196 $ echo "name translation."
2197 $ dflt = "y"
2198 $ rp = "Use secure logical name translation? [''dflt'] "
2199 $ GOSUB myread
2200 $ IF ans .eqs. "" THEN ans = dflt
2201 $ IF ans
2202 $ THEN d_secintgenv := Y
2203 $ ELSE d_secintgenv := N
2204 $ ENDIF
2205 $!
2206 $! Ask whether they want to default filetypes
2207 $ echo ""
2208 $ echo "When you pass the name of a program to Perl on the command line,"
2209 $ echo "it generally doesn't supply any defaults unless the -S command"
2210 $ echo "line switch is specified.  In keeping with the VMS tradition of"
2211 $ echo "default file types, however, you can configure Perl to try default"
2212 $ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
2213 $ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
2214 $ echo "finally foo.com)."
2215 $ echo ""
2216 $ echo "This is currently broken in some configurations. Only enable it if
2217 $ echo "you know what you're doing. "
2218 $ dflt = "n"
2219 $ rp = "Always use default file types? [''dflt'] "
2220 $ GOSUB myread
2221 $ IF ans .EQS. "" THEN ans = dflt
2222 $ IF ans
2223 $ THEN d_alwdeftype := Y
2224 $ ELSE d_alwdeftype := N
2225 $ ENDIF
2226 $!
2227 $! Ask if they want to use perl's memory allocator
2228 $ echo ""
2229 $ echo "Perl has a built-in memory allocator that's tuned for perl's
2230 $ echo "normal memory usage. It's oftentimes better than the standard
2231 $ echo "system memory allocator. It also has the advantage of providing
2232 $ echo "memory allocation statistics, if you choose to enable them.
2233 $ dflt = "n"
2234 $ rp = "Build with perl's memory allocator? [''dflt'] "
2235 $ GOSUB myread
2236 $ IF ans .eqs. "" THEN ans = dflt
2237 $ IF ans
2238 $ THEN mymalloc := Y
2239 $ ELSE mymalloc := N
2240 $ ENDIF
2241 $ IF mymalloc
2242 $ THEN
2243 $   IF use_debugging_perl
2244 $   THEN
2245 $     echo ""
2246 $     echo "Perl can keep statistics on memory usage if you choose to use
2247 $     echo "them. This is useful for debugging, but does have some
2248 $     echo "performance overhead.
2249 $     dflt = "n"
2250 $     rp = "Do you want the debugging memory allocator? [''dflt'] "
2251 $     gosub myread
2252 $     if ans.eqs."" then ans="''dflt'"
2253 $     use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
2254 $   ENDIF
2255 $   ! Check which memory allocator we want
2256 $   echo ""
2257 $   echo "There are currently three different memory allocators: the
2258 $   echo "default (which is a pretty good general-purpose memory manager),
2259 $   echo "the TWO_POT allocator (which is optimized to save memory for
2260 $   echo "larger allocations), and PACK_MALLOC (which is optimized to save
2261 $   echo "memory for smaller allocations). They're all good, but if your
2262 $   echo "usage tends towards larger chunks use TWO_POT, otherwise use
2263 $   echo "PACK_MALLOC."
2264 $   dflt = "DEFAULT"
2265 $   rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2266 $   GOSUB myread
2267 $   if ans.eqs."" then ans = "''dflt'"
2268 $   if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2269 $   if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2270 $ ENDIF
2271 $!
2272 $! Ask for their default list of extensions to build
2273 $ echo ""
2274 $ echo "It's time to specify which modules you want to build into
2275 $ echo "perl. Most of these are standard and should be chosen, though
2276 $ echo "you might, for example, want to build GDBM_File instead of
2277 $ echo "SDBM_File if you have the GDBM library built on your machine.
2278 $ echo "Whatever you do, make sure the re module is first or things will
2279 $ echo "break badly"
2280 $ echo "
2281 $ echo "Which modules do you want to build into perl?"
2282 $! dflt = "Fcntl Errno File::Glob IO Opcode Byteloader Devel::Peek Devel::DProf Data::Dumper attrs re VMS::Stdio VMS::DCLsym B SDBM_File"
2283 $ dflt = "re Fcntl Errno File::Glob IO Opcode Devel::Peek Devel::DProf Data::Dumper attrs VMS::Stdio VMS::DCLsym B SDBM_File Storable Thread Sys::Hostname"
2284 $ if Using_Dec_C
2285 $ THEN
2286 $   dflt = dflt + " POSIX"
2287 $ ENDIF
2288 $ rp = "[''dflt'] "
2289 $ GOSUB myread
2290 $ if ans.eqs."" then ans = "''dflt'"
2291 $ a = ""
2292 $ j = 0
2293 $ xloop1:
2294 $   x = f$elem(j," ",ans)
2295 $   j = j + 1
2296 $   if x .eqs. " " then goto exloop1
2297 $   xloop2:
2298 $       k = f$locate("::",x)
2299 $       if k .ge. f$len(x) then goto exloop2
2300 $       x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2301 $   goto xloop2
2302 $   exloop2:
2303 $   a = a + " " + x
2304 $ goto xloop1
2305 $ exloop1:
2306 $ ans = f$edit(a,"trim")
2307 $!
2308 $ a = ""
2309 $ j = 0
2310 $ xloop3:
2311 $   x = f$elem(j," ",dflt)
2312 $   j = j + 1
2313 $   if x .eqs. " " then goto exloop3
2314 $   xloop4:
2315 $       k = f$locate("::",x)
2316 $       if k .ge. f$len(x) then goto exloop4
2317 $       x = f$extract(0,k,x) + "/" + f$extract(k+2,f$len(x)-2,x)
2318 $   goto xloop4
2319 $   exloop4:
2320 $   a = a + " " + x
2321 $ goto xloop3
2322 $ exloop3:
2323 $ dflt = f$edit(a,"trim")
2324 $!
2325 $ extensions = "''ans'"
2326 $ known_extensions = "''dflt'"
2327 $!
2328 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2329 $ echo ""
2330 $ echo "Checking your ""make"" utilities..."
2331 $! If the 'build' that you use is not here add it and it's test
2332 $! switch to the _END_ of these strings (and increment max_build)
2333 $! (e.g. builders = builders + "/FOOMAKE" 
2334 $!       probers  = probers + " -fooVersionSwitch"
2335 $! ) & please let me know about it.
2336 $ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2337 $ probers  = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2338 $ max_build = 7
2339 $!
2340 $ orig_dflt = "MMK"
2341 $ default_set = ""
2342 $ ok_builders = ""
2343 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2344 $ WRITE CONFIG "dont_make_anything_yet:"
2345 $ WRITE CONFIG F$FAO("!_")
2346 $ CLOSE CONFIG
2347 $ n = 0
2348 $ messages = F$ENVIRONMENT("MESSAGE")
2349 $Build_probe:
2350 $ build = F$ELEMENT(n,"/",builders)
2351 $ probe  = F$ELEMENT(n,"!",probers)
2352 $ echo "Testing whether you have ''build' on your system..."
2353 $!
2354 $! Noted with GNU Make version 3.60  that the $status and $severity
2355 $! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2356 $! $SEVERITY == "4".
2357 $!
2358 $ SET NOON
2359 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2360 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2361 $ 'build' 'probe'
2362 $ IF ($SEVERITY .EQ. 1) ! not adequate?
2363 $ THEN 
2364 $   echo "OK."
2365 $   IF (build .EQS. orig_dflt) 
2366 $   THEN 
2367 $     default_set = "TRUE"
2368 $     dflt = build
2369 $   ENDIF
2370 $   ok_builders = ok_builders + " " + build
2371 $   IF (.NOT. default_set) THEN dflt = build
2372 $ ELSE 
2373 $   echo "Nope."
2374 $ ENDIF
2375 $Reenable_messages_build:
2376 $ SET MESSAGE 'messages'
2377 $ SET ON
2378 $ n = n + 1
2379 $ IF (n .LT. max_build) THEN GOTO Build_probe
2380 $!
2381 $ echo ""
2382 $ IF (ok_builders .NES. "") 
2383 $ THEN
2384 $   echo "Here is the list of builders you can apparently use:"
2385 $   echo "(",ok_builders," )"
2386 $   rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
2387 $   GOSUB myread
2388 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2389 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2390 $   IF (ans .EQS. "") 
2391 $   THEN build = dflt
2392 $   ELSE build = ans
2393 $   ENDIF
2394 $ ELSE
2395 $   TYPE SYS$INPUT:
2396
2397 %Config-E-VMS, ERROR:
2398  Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2399  utility of some sort and after checking my "builders" list I cannot find
2400  the symbol or command you use on your system to compile programs.
2401
2402 $   READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
2403 $   ans = F$EDIT(ans,"TRIM, COMPRESS")
2404 $   ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2405 $   IF (ans .EQS. "") 
2406 $   THEN build = dflt
2407 $     echo "I don't know where 'make' is, and my life depends on it."
2408 $     echo "Go find a make program or fix your DCL$PATH setting!"
2409 $     echo "ABORTING..."
2410 $     SET DEFAULT 'vms_default_directory_name' !be kind rewind
2411 $     STOP
2412 $     EXIT 2 !$STATUS = "%X00000002" (error)
2413 $   ELSE 
2414 $     build = ans
2415 $   ENDIF
2416 $ ENDIF
2417 $!
2418 $ DELETE/NOLOG Makefile.;
2419 $ GOTO Beyond_open
2420 $Open_error:
2421 $ TYPE SYS$INPUT:
2422
2423  There seems to be trouble. I just tried to create a file in
2424 $ echo4 'F$ENVIRONMENT("DEFAULT")'
2425 $ TYPE SYS$INPUT:
2426  but was unsuccessful. I am stopping now. Please check that directories'
2427  PROTECTION bits. I will leave you in the directory where you started
2428  Configure.com
2429 $ echo4 "ABORTING..."
2430 $ GOTO Clean_up
2431 $ STOP
2432 $ EXIT
2433 $!
2434 $Beyond_open:
2435 $! echo " Very well I will proceed with ""''build'"""
2436 $ make = F$EDIT(build,"UPCASE")
2437 $!
2438 $!: locate the preferred pager for this system
2439 $!pagers = "most|more|less|type/page"
2440 $!rp="What pager is used on your system? [''dflt'] "
2441 $ pager="most"
2442 $!
2443 $! update [.vms]config.vms here
2444 $!
2445 $! update makefile here
2446 $! echo4 "Updating makefile..."
2447 $!
2448 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2449 $ THEN 
2450 $   makefile    = ""               !wrt MANIFEST dir
2451 $   UUmakefile  = "[-]DESCRIP.MMS" !wrt CWD dir
2452 $   DEFmakefile = "DESCRIP.MMS"    !wrt DEF dir (?)
2453 $   Makefile_SH = "descrip_mms.template"
2454 $ ELSE
2455 $   makefile    = " -f Makefile."  !wrt MANIFEST dir
2456 $   UUmakefile  = "[-]Makefile."   !wrt CWD dir
2457 $   DEFmakefile = "Makefile."      !wrt DEF dir (?)
2458 $   Makefile_SH = "Makefile.in"
2459 $ ENDIF
2460 $!
2461 $ IF macros.NES."" 
2462 $ THEN 
2463 $   tmp = F$LENGTH(macros)
2464 $   macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2465 $   macros = "/macro=(" + macros  + ")"
2466 $ ENDIF
2467 $! Build up the extra C flags
2468 $!
2469 $ if use_ieee_math
2470 $ then
2471 $   extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
2472 $ endif
2473 $ if be_case_sensitive
2474 $ then
2475 $   extra_flags = "''extra_flags'" + "/Names=As_Is"
2476 $ endif
2477 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
2478 $!
2479 $ min_pgflquota = "100000"
2480 $ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
2481 $ IF pgflquota .LES. min_pgflquota
2482 $ THEN
2483 $   echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
2484 $   READ SYS$COMMAND/PROMPT="Continue? [n] " ans
2485 $   IF ans
2486 $   THEN
2487 $     echo4 "Continuing..."
2488 $   ELSE
2489 $     echo4 "ABORTING..."
2490 $     GOTO Clean_up
2491 $   ENDIF
2492 $ ENDIF
2493 $!
2494 $ echo ""
2495 $ echo4 "Checking the C run-time library."
2496 $!
2497 $! SUBCONFIGURE.COM
2498 $!
2499 $!  - build a config.sh for VMS Perl.
2500 $!  - use built config.sh to take config_h.SH -> config.h
2501 $!  - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
2502 $!              vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
2503 $!              vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
2504 $!  - build Build_Ext.Com extension builder procedure.
2505 $!
2506 $! Note for folks from other platforms changing things in here:
2507 $!
2508 $!   Fancy changes (based on compiler capabilities or VMS version or
2509 $!   whatever) are tricky, so go ahead and punt on those.
2510 $!
2511 $!   Simple changes, though (say, always setting something to 1, or undef,
2512 $!   or something like that) are straightforward.  Adding a new constant 
2513 $!   item for the ultimately created config.sh requires at least one 
2514 $!   (possibly more) line(s) to this file.
2515 $!
2516 $!   Add a line in the format:
2517 $!
2518 $!     $ WC "foo='undef'"
2519 $!
2520 $!   somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
2521 $!   and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
2522 $!   is sorted ASCII and corresponds to the output of config.sh in the 
2523 $!   Bourne shell version of Configure).
2524 $!   Be very careful with quoting, as it can be tricky.
2525 $!   For example if instead of a constant string like 'undef' or 'define' 
2526 $!   you wanted to add something to VMS's config.sh that looks like:
2527 $!
2528 $!     blank_string=''
2529 $!
2530 $!   then add a line that looks like this before the 
2531 $!   '##END WRITE NEW CONSTANTS HERE##' tagged line:
2532 $!
2533 $!     $ WC "blank_string='" + "'"
2534 $!
2535 $!   (+ is the string concatenator and "''var'" has the effect 
2536 $!    of "${var}" in perl or sh, but "'const'" is not interpolated).
2537 $!
2538 $!   Note that unitialized variables, such as a line like:
2539 $!
2540 $!     $ WC "new_var='" + new_var + "'"
2541 $!
2542 $!   should be avoided unless new_var has a value assigned prior 
2543 $!   to that line (think of perl's -w warnings).
2544 $!
2545 $!     %DCL-W-UNDSYM, undefined symbol - check validity and spelling
2546 $!     \NEW_VAR\
2547 $!
2548 $!
2549 $ vms_ver = F$EXTRACT(1,3, osvers)
2550 $ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
2551 $ MCC = f$edit(mcc, "UPCASE")
2552 $ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
2553 $ IF Using_Dec_C
2554 $ THEN
2555 $   Checkcc := "''Mcc'/prefix=all"
2556 $ ELSE
2557 $   IF using_cxx
2558 $   THEN
2559 $     Checkcc := cxx
2560 $   ELSE
2561 $     Checkcc := "''Mcc'"
2562 $   ENDIF
2563 $ ENDIF
2564 $ ccflags = ccflags + extra_flags
2565 $ IF be_case_sensitive
2566 $ THEN
2567 $   d_vms_be_case_sensitive = "define"
2568 $ ELSE
2569 $   d_vms_be_case_sensitive = "undef"
2570 $ ENDIF
2571 $! Some constant defaults.
2572 $ hwname = f$getsyi("HW_NAME")
2573 $ myname = myhostname
2574 $ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
2575 $!
2576 $ ccdlflags=""
2577 $ cccdlflags=""
2578 $!
2579 $ IF use64bitint .OR. use64bitint .EQS. "define"
2580 $ THEN
2581 $   use64bitint = "define"
2582 $   uselargefiles = "define"
2583 $   uselongdouble = "define"
2584 $   usemorebits = "define"
2585 $ ELSE
2586 $   use64bitint = "undef"
2587 $   uselargefiles = "undef"
2588 $   uselongdouble = "undef"
2589 $   usemorebits = "undef"
2590 $ ENDIF
2591 $ IF use64bitall .OR. use64bitall .EQS. "define"
2592 $ THEN
2593 $   use64bitall = "define"
2594 $ ELSE
2595 $   use64bitall = "undef"
2596 $ ENDIF
2597 $!
2598 $ usemymalloc=mymalloc
2599 $!
2600 $ perl_cc=Mcc
2601 $!
2602 $ IF (sharedperl .AND. F$GETSYI("HW_MODEL") .GE. 1024)
2603 $ THEN
2604 $   obj_ext=".abj"
2605 $   so="axe"
2606 $   dlext="axe"
2607 $   exe_ext=".axe"
2608 $   lib_ext=".alb"
2609 $ ELSE
2610 $   obj_ext=".obj"
2611 $   so="exe"
2612 $   dlext="exe"
2613 $   exe_ext=".exe"
2614 $   lib_ext=".olb"
2615 $ ENDIF
2616 $ dlobj="dl_vms''obj_ext'"
2617 $!
2618 $ cppstdin="''perl_cc'/noobj/preprocess=sys$output sys$input"
2619 $ cppminus=" "
2620 $ cpprun="''perl_cc'/noobj/preprocess=sys$output sys$input"
2621 $ cpplast=" "
2622 $!
2623 $ timetype="time_t"
2624 $ signal_t="void"
2625 $ stdchar="char"
2626 $!
2627 $ IF mymalloc
2628 $ THEN d_mymalloc="define"
2629 $ ELSE d_mymalloc="undef"
2630 $ ENDIF
2631 $!
2632 $ usedl="define"
2633 $ startperl="""$ perl 'f$env(\""procedure\"")' 'p1' 'p2' 'p3' 'p4' 'p5' 'p6' 'p7' 'p8'  !\n$ exit++ + ++$status != 0 and $exit = $status = undef;"""
2634 $!
2635 $ IF ((Use_Threads) .AND. (vms_ver .LES. "6.2"))
2636 $ THEN
2637 $   libs="SYS$SHARE:CMA$LIB_SHR.EXE/SHARE SYS$SHARE:CMA$RTL.EXE/SHARE SYS$SHARE:CMA$OPEN_LIB_SHR.exe/SHARE SYS$SHARE:CMA$OPEN_RTL.exe/SHARE"
2638 $ ELSE
2639 $   libs=" "
2640 $ ENDIF
2641 $ IF Using_Dec_C
2642 $ THEN
2643 $   libc="(DECCRTL)"
2644 $ ELSE
2645 $   libc=" "
2646 $ ENDIF
2647 $!
2648 $! Are we 64 bit?
2649 $!
2650 $ IF use64bitint .OR. use64bitint .EQS. "define"
2651 $ THEN
2652 $   d_PRId64 = "define"
2653 $   d_PRIfldbl = "define"
2654 $   d_PRIgldbl = "define"
2655 $   d_PRIu64 = "define"
2656 $   d_PRIo64 = "define"
2657 $   d_PRIx64 = "define"
2658 $   sPRId64 = """Ld"""
2659 $!   sPRIeldbl = """Lf"""
2660 $   sPRIfldbl = """Lf"""
2661 $   sPRIgldbl = """Lg"""
2662 $!   sPRIi64 = """Li"""
2663 $   sPRIo64 = """Lo"""
2664 $   sPRIu64 = """Lu"""
2665 $   sPRIx64 = """Lx"""
2666 $   d_quad = "define"
2667 $   quadtype = "long long"
2668 $   uquadtype = "unsigned long long"
2669 $   quadkind  = "QUAD_IS_LONG_LONG"
2670 $   d_frexpl = "define"
2671 $   d_isnanl = "define"
2672 $   d_modfl = "define"
2673 $ ELSE
2674 $   d_PRId64 = "undef"
2675 $   d_PRIfldbl = "undef"
2676 $   d_PRIgldbl = "undef"
2677 $   d_PRIu64 = "undef"
2678 $   d_PRIo64 = "undef"
2679 $   d_PRIx64 = "undef"
2680 $   sPRId64 = ""
2681 $!   sPRIeldbl = ""
2682 $   sPRIfldbl = ""
2683 $   sPRIgldbl = ""
2684 $!   sPRIi64 = ""
2685 $   sPRIo64 = ""
2686 $   sPRIu64 = ""
2687 $   sPRIx64 = ""
2688 $   d_quad = "undef"
2689 $   quadtype = "long"
2690 $   uquadtype = "unsigned long"
2691 $   quadkind  = "QUAD_IS_LONG"
2692 $   d_frexpl = "undef"
2693 $   d_isnanl = "undef"
2694 $   d_modfl = "undef"
2695 $ ENDIF
2696 $!
2697 $! Now some that we build up
2698 $!
2699 $ IF Use_Threads
2700 $ THEN
2701 $   IF use_5005_threads
2702 $   THEN
2703 $     arch = "''arch'-thread"
2704 $     archname = "''archname'-thread"
2705 $     d_old_pthread_create_joinable = "undef"
2706 $     old_pthread_create_joinable = " "
2707 $     use5005threads = "define"
2708 $     useithreads = "undef"
2709 $   ELSE
2710 $     arch = "''arch'-ithread"
2711 $     archname = "''archname'-ithread"
2712 $     d_old_pthread_create_joinable = "undef"
2713 $     old_pthread_create_joinable = " "
2714 $     use5005threads = "undef"
2715 $     useithreads = "define"
2716 $   ENDIF
2717 $ ELSE
2718 $   d_old_pthread_create_joinable = "undef"
2719 $   old_pthread_create_joinable = " "
2720 $   use5005threads = "undef"
2721 $   useithreads = "undef"
2722 $ ENDIF
2723 $!
2724 $! Some that we need to invoke the compiler for
2725 $!
2726 $!
2727 $! handy construction aliases/symbols
2728 $!
2729 $ OS := "open/write CONFIG []try.c"
2730 $ WS := "write CONFIG"
2731 $ CS := "close CONFIG"
2732 $ DS := "delete/nolog/noconfirm []try.*;*"
2733 $ Needs_Opt := N
2734 $ good_compile = %X10B90001
2735 $ IF Using_Gnu_C
2736 $ THEN
2737 $   open/write OPTCHAN []try.opt
2738 $   write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
2739 $   write OPTCHAN "Sys$Share:VAXCRTL/Share"
2740 $   Close OPTCHAN
2741 $   Needs_Opt := Y
2742 $   good_compile = %X10000001
2743 $ ENDIF
2744 $ IF using_cxx
2745 $ THEN
2746 $   good_compile = %X15F60001
2747 $ ENDIF
2748 $ good_link = %X10000001
2749 $ tmp = "" ! null string default
2750 $!
2751 $ GOTO beyond_compile_ok
2752 $!
2753 $! Check for type sizes 
2754 $!
2755 $type_size_check: 
2756 $!
2757 $ OS
2758 $ WS "#ifdef __DECC
2759 $ WS "#include <stdlib.h>
2760 $ WS "#endif
2761 $ WS "#include <stdio.h>
2762 $ WS "int main()
2763 $ WS "{"
2764 $ WS "printf(""%d\n"", sizeof(''tmp'));"
2765 $ WS "exit(0);
2766 $ WS "}"
2767 $ CS
2768 $ GOSUB compile
2769 $ RETURN
2770 $!
2771 $!: locate header file
2772 $findhdr:
2773 $!
2774 $ OS
2775 $ WS "#ifdef __DECC
2776 $ WS "#include <stdlib.h>
2777 $ WS "#endif
2778 $ WS "#include <stdio.h>
2779 $ WS "#include <''tmp'>"
2780 $ WS "int main()
2781 $ WS "{"
2782 $ WS "printf(""define\n"");"
2783 $ WS "exit(0);
2784 $ WS "}"
2785 $ CS
2786 $ GOSUB link_ok
2787 $ RETURN
2788 $!
2789 $!: define an alternate in-header-list? function
2790 $inhdr:
2791 $!
2792 $ GOSUB findhdr
2793 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
2794 $ THEN
2795 $   echo4 "<''tmp'> found."
2796 $   tmp = "define"
2797 $ ELSE
2798 $   echo4 "<''tmp'> NOT found."
2799 $   tmp = "undef"
2800 $ ENDIF
2801 $ RETURN
2802 $!
2803 $!: define an is-in-libc? function
2804 $inlibc: 
2805 $ GOSUB link_ok
2806 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
2807 $ THEN
2808 $   echo4 "''tmp'() found."
2809 $   tmp = "define"
2810 $ ELSE
2811 $   echo4 "''tmp'() NOT found."
2812 $   tmp = "undef"
2813 $ ENDIF
2814 $ RETURN
2815 $!
2816 $!: define a shorthand compile call
2817 $compile:
2818 $ GOSUB link_ok
2819 $just_mcr_it:
2820 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
2821 $ THEN
2822 $   OPEN/WRITE CONFIG []try.out
2823 $   DEFINE/USER_MODE SYS$ERROR CONFIG
2824 $   DEFINE/USER_MODE  SYS$OUTPUT CONFIG
2825 $   MCR []try.exe
2826 $   CLOSE CONFIG
2827 $   OPEN/READ CONFIG []try.out
2828 $   READ CONFIG tmp
2829 $   CLOSE CONFIG
2830 $   DELETE/NOLOG/NOCONFIRM []try.out;
2831 $   DELETE/NOLOG/NOCONFIRM []try.exe;
2832 $ ELSE
2833 $   tmp = "" ! null string default
2834 $ ENDIF
2835 $ RETURN
2836 $!
2837 $link_ok:
2838 $ GOSUB compile_ok
2839 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
2840 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
2841 $ SET NOON
2842 $ IF Needs_Opt
2843 $ THEN
2844 $   'ld' try.obj,try.opt/opt
2845 $   link_status = $status
2846 $ ELSE
2847 $   'ld' try.obj
2848 $   link_status = $status
2849 $ ENDIF
2850 $ SET ON
2851 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
2852 $ RETURN
2853 $!
2854 $!: define a shorthand compile call for compilations that should be ok.
2855 $compile_ok:
2856 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
2857 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
2858 $ SET NOON
2859 $ 'Checkcc' try.c
2860 $ compile_status = $status
2861 $ SET ON
2862 $ DELETE/NOLOG/NOCONFIRM try.c;
2863 $ RETURN
2864 $!
2865 $beyond_compile_ok:
2866 $!
2867 $! Check for __STDC__
2868 $!
2869 $ OS
2870 $ WS "#ifdef __DECC
2871 $ WS "#include <stdlib.h>
2872 $ WS "#endif
2873 $ WS "#include <stdio.h>
2874 $ WS "int main()
2875 $ WS "{"
2876 $ WS "#ifdef __STDC__
2877 $ WS "printf(""42\n"");
2878 $ WS "#else
2879 $ WS "printf(""1\n"");
2880 $ WS "#endif
2881 $ WS "exit(0);
2882 $ WS "}"
2883 $ CS
2884 $ GOSUB compile
2885 $ cpp_stuff=tmp
2886 $ IF F$INTEGER(tmp) .eq. 42
2887 $ THEN
2888 $   echo4 "Your C compiler and pre-processor defines the symbol:"
2889 $   echo4 "__STDC__"
2890 $ ENDIF
2891 $!
2892 $! Check for double size
2893 $!
2894 $ echo4 "Checking to see how big your double precision numbers are..."
2895 $ tmp="double"
2896 $ GOSUB type_size_check
2897 $ doublesize = tmp
2898 $ echo "Your double is ''doublesize' bytes long."
2899 $!
2900 $! Check for long double size
2901 $!
2902 $ OS
2903 $ WS "#ifdef __DECC
2904 $ WS "#include <stdlib.h>
2905 $ WS "#endif
2906 $ WS "#include <stdio.h>
2907 $ WS "int main()
2908 $ WS "{"
2909 $ WS "printf(""%d\n"", sizeof(long double));
2910 $ WS "exit(0);
2911 $ WS "}"
2912 $ CS
2913 $ echo4 "Checking to see if you have long double..."
2914 $ GOSUB link_ok
2915 $ IF link_status .NE. good_link
2916 $ THEN
2917 $   longdblsize="0"
2918 $   d_longdbl="undef"
2919 $   echo "You do not have long double."
2920 $ ELSE
2921 $   echo "You have long double."
2922 $   echo4 "Checking to see how big your long doubles are..."
2923 $   GOSUB just_mcr_it
2924 $   longdblsize = tmp
2925 $   d_longdbl = "define"
2926 $   echo "Your long doubles are ''longdblsize' bytes long."
2927 $ ENDIF
2928 $!
2929 $!: check for long long
2930 $ OS
2931 $ WS "#ifdef __DECC
2932 $ WS "#include <stdlib.h>
2933 $ WS "#endif
2934 $ WS "#include <stdio.h>
2935 $ WS "int main()
2936 $ WS "{"
2937 $ WS "printf(""%d\n"", sizeof(long long));
2938 $ WS "exit(0);
2939 $ WS "}"
2940 $ CS
2941 $ echo4 "Checking to see if you have long long..."
2942 $ GOSUB link_ok
2943 $ IF link_status .NE. good_link
2944 $ THEN
2945 $   longlongsize="0"
2946 $   d_longlong="undef"
2947 $   echo "You do not have long long."
2948 $ ELSE
2949 $   echo "You have long long."
2950 $   echo4 "Checking to see how big your long longs are..."
2951 $   GOSUB just_mcr_it
2952 $   longlongsize = tmp
2953 $   d_longlong = "define"
2954 $   echo "Your long longs are ''longlongsize' bytes long."
2955 $ ENDIF
2956 $!
2957 $! Check the prototype for getgid
2958 $!
2959 $ echo "Looking for the type for group ids returned by getgid()."
2960 $ OS
2961 $ WS "#ifdef __DECC
2962 $ WS "#include <stdlib.h>
2963 $ WS "#endif
2964 $ WS "#include <stdio.h>
2965 $ WS "#include <types.h>
2966 $ WS "int main()
2967 $ WS "{"
2968 $ WS "gid_t foo;
2969 $ WS "exit(0);
2970 $ WS "}"
2971 $ CS
2972 $ GOSUB compile_ok
2973 $ IF compile_status .NE. good_compile
2974 $ THEN
2975 $!   Okay, gid_t failed. Must be unsigned int
2976 $   gidtype = "unsigned int"
2977 $   echo4 "assuming ""''gidtype'""."
2978 $ ELSE
2979 $   gidtype = "gid_t"
2980 $   echo4 "gid_t found."
2981 $ ENDIF
2982 $!
2983 $! Check to see if we've got dev_t
2984 $!
2985 $ echo "Looking for the type for dev."
2986 $ OS
2987 $ WS "#ifdef __DECC
2988 $ WS "#include <stdlib.h>
2989 $ WS "#endif
2990 $ WS "#include <stdio.h>
2991 $ WS "#include <types.h>
2992 $ WS "int main()
2993 $ WS "{"
2994 $ WS "dev_t foo;
2995 $ WS "exit(0);
2996 $ WS "}"
2997 $ CS
2998 $ GOSUB compile_ok
2999 $ IF compile_status .NE. good_compile
3000 $ THEN
3001 $!   Okay, dev_t failed. Must be unsigned int
3002 $   devtype = "unsigned int"
3003 $   echo4 "assuming ""''devtype'""."
3004 $ ELSE
3005 $   devtype = "dev_t"
3006 $   echo4 "dev_t found."
3007 $ ENDIF
3008 $!
3009 $! Check to see if we've got unistd.h (which we ought to, but you never know)
3010 $!
3011 $ i_netdb = "undef"
3012 $ tmp = "unistd.h"
3013 $ GOSUB inhdr
3014 $ i_unistd = tmp
3015 $!
3016 $!: see if this is a libutil.h system
3017 $!
3018 $ tmp = "libutil.h"
3019 $ GOSUB inhdr
3020 $ i_libutil = tmp
3021 $!
3022 $! Check to see if we've got shadow.h (probably not, but...)
3023 $!
3024 $ tmp = "shadow.h"
3025 $ GOSUB inhdr
3026 $ i_shadow = tmp
3027 $!
3028 $! Check to see if we've got socks.h (probably not, but...)
3029 $!
3030 $ tmp = "socks.h"
3031 $ GOSUB inhdr
3032 $ i_socks = tmp
3033 $!
3034 $! Check the prototype for select
3035 $!
3036 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3037 $ THEN
3038 $   OS
3039 $   WS "#ifdef __DECC
3040 $   WS "#include <stdlib.h>
3041 $   WS "#endif
3042 $   WS "#include <stdio.h>
3043 $   WS "#include <types.h>
3044 $   IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>
3045 $   IF Has_Socketshr
3046 $   THEN
3047 $     WS "#include <socketshr.h>"
3048 $   ELSE
3049 $     WS "#include <time.h>
3050 $     WS "#include <socket.h>
3051 $   ENDIF
3052 $   WS "int main()
3053 $   WS "{"
3054 $   WS "fd_set *foo;
3055 $   WS "int bar;
3056 $   WS "foo = NULL;
3057 $   WS "bar = select(2, foo, foo, foo, NULL);
3058 $   WS "exit(0);
3059 $   WS "}"
3060 $   CS
3061 $   GOSUB compile_ok
3062 $   IF compile_status .NE. good_compile
3063 $   THEN
3064 $!   Okay, select failed.  Must be an int *
3065 $     selecttype = "int *"
3066 $     echo4 "select() NOT found."
3067 $   ELSE
3068 $     selecttype="fd_set *"
3069 $     echo4 "select() found."
3070 $   ENDIF
3071 $ ELSE
3072 $   ! No sockets, so stick in an int * : no select, so pick a harmless default
3073 $   selecttype = "int *"
3074 $ ENDIF
3075 $!
3076 $! Check to see if fd_set exists
3077 $!
3078 $ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3079 $ OS
3080 $ WS "#ifdef __DECC
3081 $ WS "#include <stdlib.h>
3082 $ WS "#endif
3083 $ WS "#include <stdio.h>
3084 $ WS "#include <types.h>
3085 $ IF Has_Socketshr
3086 $ THEN
3087 $   WS "#include <socketshr.h>"
3088 $ ENDIF
3089 $ IF Has_Dec_C_Sockets
3090 $ THEN
3091 $   WS "#include <time.h>
3092 $   WS "#include <socket.h>
3093 $ ENDIF
3094 $ WS "int main()
3095 $ WS "{"
3096 $ WS "fd_set *foo;
3097 $ WS "int bar;
3098 $ WS "exit(0);
3099 $ WS "}"
3100 $ CS
3101 $ GOSUB compile_ok
3102 $ IF compile_status .ne. good_compile
3103 $ THEN
3104 $!  Okay, fd_set failed. Must not exist
3105 $   d_fd_set = "undef"
3106 $   echo4 "Hmm, your compiler has some difficulty with fd_set."
3107 $ ELSE
3108 $   d_fd_set="define"
3109 $   echo4 "Well, your system knows about the normal fd_set typedef..."
3110 $ ENDIF
3111 $!
3112 $! Check for inttypes.h
3113 $!
3114 $ tmp = "inttypes.h"
3115 $ GOSUB inhdr
3116 $ i_inttypes = tmp
3117 $!
3118 $! Check to see if off64_t exists
3119 $!
3120 $ echo4 "Checking to see if you have off64_t..."
3121 $ OS
3122 $ WS "#ifdef __DECC
3123 $ WS "#include <stdlib.h>
3124 $ WS "#endif
3125 $ WS "#include <stdio.h>
3126 $ WS "#include <types.h>
3127 $ WS "#''i_inttypes IIH
3128 $ WS "#ifdef IIH
3129 $ WS "#include <inttypes.h>
3130 $ WS "#endif
3131 $ WS "int main()
3132 $ WS "{"
3133 $ WS "off64_t bar;
3134 $ WS "exit(0);
3135 $ WS "}"
3136 $ CS
3137 $ GOSUB compile_ok
3138 $ IF compile_status .EQ. good_compile
3139 $ THEN
3140 $   d_off64_t="define"
3141 $   echo "You have off64_t."
3142 $ ELSE
3143 $   d_off64_t = "undef"
3144 $   echo "You do not have off64_t."
3145 $ ENDIF
3146 $!
3147 $! Check to see if fpos64_t exists
3148 $!
3149 $ echo4 "Checking to see if you have fpos64_t..."
3150 $ OS
3151 $ WS "#ifdef __DECC
3152 $ WS "#include <stdlib.h>
3153 $ WS "#endif
3154 $ WS "#include <stdio.h>
3155 $ WS "#include <types.h>
3156 $ WS "#''i_inttypes IIH
3157 $ WS "#ifdef IIH
3158 $ WS "#include <inttypes.h>
3159 $ WS "#endif
3160 $ WS "int main()
3161 $ WS "{"
3162 $ WS "fpos64_t bar;
3163 $ WS "exit(0);
3164 $ WS "}"
3165 $ CS
3166 $ GOSUB compile_ok
3167 $ IF compile_status .EQ. good_compile
3168 $ THEN
3169 $   d_fpos64_t="define"
3170 $   echo "You have fpos64_t."
3171 $ ELSE
3172 $   d_fpos64_t = "undef"
3173 $   echo "You do not have fpos64_t."
3174 $ ENDIF
3175 $!
3176 $! Check to see if int64_t exists
3177 $!
3178 $ echo4 "Checking to see if you have int64_t..."
3179 $ OS
3180 $ WS "#ifdef __DECC
3181 $ WS "#include <stdlib.h>
3182 $ WS "#endif
3183 $ WS "#include <stdio.h>
3184 $ WS "#include <types.h>
3185 $ WS "#''i_inttypes IIH
3186 $ WS "#ifdef IIH
3187 $ WS "#include <inttypes.h>
3188 $ WS "#endif
3189 $ WS "int main()
3190 $ WS "{"
3191 $ WS "int64_t bar;
3192 $ WS "exit(0);
3193 $ WS "}"
3194 $ CS
3195 $ GOSUB compile_ok
3196 $ IF compile_status .EQ. good_compile
3197 $ THEN
3198 $   d_int64_t="define"
3199 $   echo "You have int64_t."
3200 $ ELSE
3201 $   d_int64_t = "undef"
3202 $   echo "You do not have int64_t."
3203 $ ENDIF
3204 $!
3205 $!: see if this is a netdb.h system
3206 $ IF Has_Dec_C_Sockets
3207 $ THEN 
3208 $   tmp = "netdb.h"
3209 $   GOSUB inhdr
3210 $   i_netdb = tmp
3211 $ ENDIF
3212 $!
3213 $! Check for h_errno
3214 $!
3215 $ echo4 "Checking to see if you have h_errno..."
3216 $ OS
3217 $ WS "#ifdef __DECC
3218 $ WS "#include <stdlib.h>
3219 $ WS "#endif
3220 $ WS "#include <stdio.h>
3221 $ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>
3222 $ IF i_netdb  .EQS. "define" THEN WS "#include <netdb.h>
3223 $ WS "int main()
3224 $ WS "{"
3225 $ WS "h_errno = 3;
3226 $ WS "exit(0);
3227 $ WS "}"
3228 $ CS
3229 $ GOSUB link_ok
3230 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3231 $ THEN
3232 $   d_herrno="define"
3233 $   echo "You have h_errno."
3234 $ ELSE
3235 $   d_herrno="undef"
3236 $   echo "You do not have h_errno."
3237 $ ENDIF
3238 $!
3239 $! Check to see if gethostname exists
3240 $!
3241 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3242 $ THEN
3243 $   OS
3244 $   WS "#ifdef __DECC
3245 $   WS "#include <stdlib.h>
3246 $   WS "#endif
3247 $   WS "#include <stdio.h>
3248 $   WS "#include <types.h>
3249 $   IF Has_Socketshr
3250 $   THEN
3251 $     WS "#include <socketshr.h>"
3252 $   ELSE
3253 $     WS "#include <time.h>
3254 $     WS "#include <socket.h>
3255 $   ENDIF
3256 $   WS "int main()
3257 $   WS "{"
3258 $   WS "char name[100];
3259 $   WS "int bar, baz;
3260 $   WS "bar = 100;
3261 $   WS "baz = gethostname(name, bar);
3262 $   WS "exit(0);
3263 $   WS "}"
3264 $   CS
3265 $   GOSUB link_ok
3266 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3267 $   THEN
3268 $     d_gethname="define"
3269 $     echo4 "gethostname() found."
3270 $   ELSE
3271 $     d_gethname="undef"
3272 $   ENDIF
3273 $ ELSE
3274 $   ! No sockets, so no gethname
3275 $   d_gethname = "undef"
3276 $ ENDIF
3277 $!
3278 $! Check for sys/file.h
3279 $!
3280 $ tmp = "sys/file.h"
3281 $ GOSUB inhdr
3282 $ i_sysfile = tmp
3283 $!
3284 $! Check for sys/utsname.h
3285 $!
3286 $ tmp = "sys/utsname.h"
3287 $ GOSUB inhdr
3288 $ i_sysutsname = tmp
3289 $!
3290 $! Check for syslog.h
3291 $!
3292 $ tmp = "syslog.h"
3293 $ GOSUB inhdr
3294 $ i_syslog = tmp
3295 $!
3296 $! Check for poll.h
3297 $!
3298 $ tmp = "poll.h"
3299 $ GOSUB inhdr
3300 $ i_poll = tmp
3301 $!
3302 $! Check for sys/uio.h
3303 $!
3304 $ tmp = "sys/uio.h"
3305 $ GOSUB inhdr
3306 $ i_sysuio = tmp
3307 $!
3308 $! Check for sys/mode.h
3309 $!
3310 $ tmp = "sys/mode.h"
3311 $ GOSUB inhdr
3312 $ i_sysmode = tmp
3313 $!
3314 $! Check for sys/access.h
3315 $!
3316 $ tmp = "sys/access.h"
3317 $ GOSUB inhdr
3318 $ i_sysaccess = tmp
3319 $!
3320 $! Check for sys/security.h
3321 $!
3322 $ tmp = "sys/security.h"
3323 $ GOSUB inhdr
3324 $ i_syssecrt = tmp
3325 $!
3326 $! Check for fcntl.h
3327 $!
3328 $ tmp = "fcntl.h"
3329 $ GOSUB inhdr
3330 $ i_fcntl = tmp
3331 $!
3332 $! Check for fcntl
3333 $!
3334 $ OS
3335 $ WS "#ifdef __DECC
3336 $ WS "#include <stdlib.h>
3337 $ WS "#endif
3338 $ WS "#include <stdio.h>
3339 $ WS "#include <fcntl.h>
3340 $ WS "int main()
3341 $ WS "{"
3342 $ WS "fcntl(1,2,3);
3343 $ WS "exit(0);
3344 $ WS "}"
3345 $ CS
3346 $ tmp = "fcntl"
3347 $ GOSUB inlibc
3348 $ d_fcntl = tmp
3349 $!
3350 $! Check for memchr
3351 $!
3352 $ OS
3353 $ WS "#ifdef __DECC
3354 $ WS "#include <stdlib.h>
3355 $ WS "#endif
3356 $ WS "#include <string.h>
3357 $ WS "int main()
3358 $ WS "{"
3359 $ WS "char * place;
3360 $ WS "place = memchr(""foo"", 47, 3)
3361 $ WS "exit(0);
3362 $ WS "}"
3363 $ CS
3364 $ tmp = "memchr"
3365 $ GOSUB inlibc
3366 $ d_memchr = tmp
3367 $!
3368 $! Check for strtoull
3369 $!
3370 $ OS
3371 $ WS "#ifdef __DECC
3372 $ WS "#include <stdlib.h>
3373 $ WS "#endif
3374 $ WS "#include <string.h>
3375 $ WS "int main()
3376 $ WS "{"
3377 $ WS "unsigned __int64 result;
3378 $ WS "result = strtoull(""123123"", NULL, 10);
3379 $ WS "exit(0);
3380 $ WS "}"
3381 $ CS
3382 $ tmp = "strtoull"
3383 $ GOSUB inlibc
3384 $ d_strtoull = tmp
3385 $!
3386 $! Check for strtouq
3387 $!
3388 $ OS
3389 $ WS "#ifdef __DECC
3390 $ WS "#include <stdlib.h>
3391 $ WS "#endif
3392 $ WS "#include <string.h>
3393 $ WS "int main()
3394 $ WS "{"
3395 $ WS "unsigned __int64 result;
3396 $ WS "result = strtouq(""123123"", NULL, 10);
3397 $ WS "exit(0);
3398 $ WS "}"
3399 $ CS
3400 $ tmp = "strtouq"
3401 $ GOSUB inlibc
3402 $ d_strtouq = tmp
3403 $!
3404 $! Check for strtoll
3405 $!
3406 $ OS
3407 $ WS "#ifdef __DECC
3408 $ WS "#include <stdlib.h>
3409 $ WS "#endif
3410 $ WS "#include <string.h>
3411 $ WS "int main()
3412 $ WS "{"
3413 $ WS "__int64 result;
3414 $ WS "result = strtoll(""123123"", NULL, 10);
3415 $ WS "exit(0);
3416 $ WS "}"
3417 $ CS
3418 $ tmp = "strtoll"
3419 $ GOSUB inlibc
3420 $ d_strtoll = tmp
3421 $!
3422 $! Check for strtold
3423 $!
3424 $ OS
3425 $ WS "#ifdef __DECC
3426 $ WS "#include <stdlib.h>
3427 $ WS "#endif
3428 $ WS "#include <string.h>
3429 $ WS "int main()
3430 $ WS "{"
3431 $ WS "long double result;
3432 $ WS "result = strtold(""123123"", NULL, 10);
3433 $ WS "exit(0);
3434 $ WS "}"
3435 $ CS
3436 $ tmp = "strtold"
3437 $ GOSUB inlibc
3438 $ d_strtold = tmp
3439 $!
3440 $! Check for atoll
3441 $!
3442 $ OS
3443 $ WS "#ifdef __DECC
3444 $ WS "#include <stdlib.h>
3445 $ WS "#endif
3446 $ WS "#include <string.h>
3447 $ WS "int main()
3448 $ WS "{"
3449 $ WS " __int64 result;
3450 $ WS "result = atoll(""123123"");
3451 $ WS "exit(0);
3452 $ WS "}"
3453 $ CS
3454 $ tmp = "atoll"
3455 $ GOSUB inlibc
3456 $ d_atoll = tmp
3457 $!
3458 $! Check for atolf
3459 $!
3460 $ OS
3461 $ WS "#ifdef __DECC
3462 $ WS "#include <stdlib.h>
3463 $ WS "#endif
3464 $ WS "#include <string.h>
3465 $ WS "int main()
3466 $ WS "{"
3467 $ WS "long double
3468 $ WS "result = atolf(""123123"");
3469 $ WS "exit(0);
3470 $ WS "}"
3471 $ CS
3472 $ tmp = "atolf"
3473 $ GOSUB inlibc
3474 $ d_atolf = tmp
3475 $!
3476 $! Check for access
3477 $!
3478 $ OS
3479 $ WS "#ifdef __DECC
3480 $ WS "#include <stdlib.h>
3481 $ WS "#endif
3482 $ WS "#include <stdio.h>
3483 $ WS "int main()
3484 $ WS "{"
3485 $ WS "access("foo", F_OK);
3486 $ WS "exit(0);
3487 $ WS "}"
3488 $ CS
3489 $ tmp = "acess"
3490 $ GOSUB inlibc
3491 $ d_access = tmp
3492 $!
3493 $! Check for bzero
3494 $!
3495 $ OS
3496 $ WS "#ifdef __DECC
3497 $ WS "#include <stdlib.h>
3498 $ WS "#endif
3499 $ WS "#include <stdio.h>
3500 $ WS "#include <strings.h>
3501 $ WS "int main()
3502 $ WS "{"
3503 $ WS "char foo[10];
3504 $ WS "bzero(foo, 10);
3505 $ WS "exit(0);
3506 $ WS "}"
3507 $ CS
3508 $ tmp = "bzero"
3509 $ GOSUB inlibc
3510 $ d_bzero = tmp
3511 $!
3512 $! Check for bcopy
3513 $!
3514 $ OS
3515 $ WS "#ifdef __DECC
3516 $ WS "#include <stdlib.h>
3517 $ WS "#endif
3518 $ WS "#include <stdio.h>
3519 $ WS "#include <strings.h>
3520 $ WS "int main()
3521 $ WS "{"
3522 $ WS "char foo[10], bar[10];
3523 $ WS "bcopy(""foo"", bar, 3);
3524 $ WS "exit(0);
3525 $ WS "}"
3526 $ CS
3527 $ tmp = "bcopy"
3528 $ GOSUB inlibc
3529 $ d_bcopy = tmp
3530 $!
3531 $! Check for mkstemp
3532 $!
3533 $ OS
3534 $ WS "#ifdef __DECC
3535 $ WS "#include <stdlib.h>
3536 $ WS "#endif
3537 $ WS "#include <stdio.h>
3538 $ WS "int main()
3539 $ WS "{"
3540 $ WS "mkstemp(""foo"");
3541 $ WS "exit(0);
3542 $ WS "}"
3543 $ CS
3544 $ tmp = "mkstemp"
3545 $ GOSUB inlibc
3546 $ d_mkstemp = tmp
3547 $!
3548 $! Check for mkstemps
3549 $!
3550 $ OS
3551 $ WS "#ifdef __DECC
3552 $ WS "#include <stdlib.h>
3553 $ WS "#endif
3554 $ WS "#include <stdio.h>
3555 $ WS "int main()
3556 $ WS "{"
3557 $ WS "mkstemps(""foo"", 1);
3558 $ WS "exit(0);
3559 $ WS "}"
3560 $ CS
3561 $ tmp = "mkstemps"
3562 $ GOSUB inlibc
3563 $ d_mkstemps = tmp
3564 $!
3565 $! Check for iconv
3566 $!
3567 $ OS
3568 $ WS "#ifdef __DECC
3569 $ WS "#include <stdlib.h>
3570 $ WS "#endif
3571 $ WS "#include <stdio.h>
3572 $ WS "#include <iconv.h>
3573 $ WS "int main()
3574 $ WS "{"
3575 $ WS "  iconv_t cd = (iconv_t)0;"
3576 $ WS "  char *inbuf, *outbuf;"
3577 $ WS "  size_t inleft, outleft;"
3578 $ WS "  iconv(cd, &inbuf, &inleft, &outbuf, &outleft);"
3579 $ WS "exit(0);
3580 $ WS "}"
3581 $ CS
3582 $ GOSUB link_ok
3583 $ IF compile_status .ne. good_compile
3584 $ THEN
3585 $   d_iconv="undef"
3586 $   i_iconv="undef"
3587 $ ELSE
3588 $   IF link_status .ne. good_link
3589 $   THEN
3590 $     d_iconv="undef"
3591 $     i_iconv="undef"
3592 $   ELSE
3593 $     d_iconv="define"
3594 $     i_iconv="define"
3595 $   ENDIF
3596 $ ENDIF
3597 $ IF i_iconv .eqs. "define" 
3598 $ THEN echo4 "<iconv.h> found."
3599 $ ELSE echo4 "<iconv.h> NOT found."
3600 $ ENDIF
3601 $!
3602 $! Check for mkdtemp
3603 $!
3604 $ OS
3605 $ WS "#ifdef __DECC
3606 $ WS "#include <stdlib.h>
3607 $ WS "#endif
3608 $ WS "#include <stdio.h>
3609 $ WS "int main()
3610 $ WS "{"
3611 $ WS "mkdtemp(""foo"");
3612 $ WS "exit(0);
3613 $ WS "}"
3614 $ CS
3615 $ tmp = "mkdtemp"
3616 $ GOSUB inlibc
3617 $ d_mkdtemp = tmp
3618 $!
3619 $! Check for setvbuf
3620 $!
3621 $ OS
3622 $ WS "#ifdef __DECC
3623 $ WS "#include <stdlib.h>
3624 $ WS "#endif
3625 $ WS "#include <stdio.h>
3626 $ WS "int main()
3627 $ WS "{"
3628 $ WS "FILE *foo;
3629 $ WS "char Buffer[99];
3630 $ WS "foo = fopen(""foo"", ""r"");
3631 $ WS "setvbuf(foo, Buffer, 0, 0);
3632 $ WS "exit(0);
3633 $ WS "}"
3634 $ CS
3635 $ tmp = "setvbuf"
3636 $ GOSUB inlibc
3637 $ d_setvbuf = tmp
3638 $!
3639 $! Check for setenv
3640 $!
3641 $ OS
3642 $ WS "#ifdef __DECC
3643 $ WS "#include <stdlib.h>
3644 $ WS "#endif
3645 $ WS "#include <stdio.h>
3646 $ WS "int main()
3647 $ WS "{"
3648 $ WS "setenv(""FOO"", ""BAR"", 0);
3649 $ WS "exit(0);
3650 $ WS "}"
3651 $ CS
3652 $ tmp = "setenv"
3653 $ GOSUB inlibc
3654 $ d_setenv = tmp
3655 $!
3656 $! Check for setproctitle
3657 $!
3658 $ OS
3659 $ WS "#ifdef __DECC
3660 $ WS "#include <stdlib.h>
3661 $ WS "#endif
3662 $ WS "#include <stdio.h>
3663 $ WS "int main()
3664 $ WS "{"
3665 $ WS "setproctitle(""%s"", ""FOO"");
3666 $ WS "exit(0);
3667 $ WS "}"
3668 $ CS
3669 $ tmp = "setproctitle"
3670 $ GOSUB inlibc
3671 $ d_setproctitle = tmp
3672 $!
3673 $! Check for <netinet/in.h>
3674 $!
3675 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
3676 $ THEN
3677 $   tmp = "netinet/in.h"
3678 $   GOSUB inhdr
3679 $   i_niin = tmp
3680 $ ELSE
3681 $   i_niin="undef"
3682 $ ENDIF
3683 $!
3684 $! Check for <netinet/tcp.h>
3685 $!
3686 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
3687 $ THEN
3688 $   tmp = "netinet/tcp.h"
3689 $   GOSUB inhdr
3690 $   i_netinettcp = tmp
3691 $ ELSE
3692 $   i_netinettcp="undef"
3693 $ ENDIF
3694 $!
3695 $! Check for endhostent
3696 $!
3697 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
3698 $ THEN
3699 $   OS
3700 $   WS "#ifdef __DECC
3701 $   WS "#include <stdlib.h>
3702 $   WS "#endif
3703 $   WS "#include <stdio.h>
3704 $   IF Has_Socketshr
3705 $   THEN WS "#include <socketshr.h>"
3706 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3707 $   ENDIF
3708 $   WS "int main()
3709 $   WS "{"
3710 $   WS "endhostent();
3711 $   WS "exit(0);
3712 $   WS "}"
3713 $   CS
3714 $   tmp = "endhostent"
3715 $   GOSUB inlibc
3716 $   d_endhent = tmp
3717 $ ELSE
3718 $   d_endhent="undef"
3719 $ ENDIF
3720 $!
3721 $! Check for endnetent
3722 $!
3723 $ IF Has_Dec_C_Sockets .or. Has_Socketshr
3724 $ THEN
3725 $   OS
3726 $   WS "#ifdef __DECC
3727 $   WS "#include <stdlib.h>
3728 $   WS "#endif
3729 $   WS "#include <stdio.h>
3730 $   IF Has_Socketshr
3731 $   THEN WS "#include <socketshr.h>"
3732 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3733 $   ENDIF
3734 $   WS "int main()"
3735 $   WS "{"
3736 $   WS "endnetent();"
3737 $   WS "exit(0);"
3738 $   WS "}"
3739 $   CS
3740 $   tmp = "endnetent"
3741 $   GOSUB inlibc
3742 $   d_endnent = tmp
3743 $ ELSE
3744 $   d_endnent="undef"
3745 $ ENDIF
3746 $!
3747 $! Check for endprotoent
3748 $!
3749 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3750 $ THEN
3751 $   OS
3752 $   WS "#ifdef __DECC
3753 $   WS "#include <stdlib.h>
3754 $   WS "#endif
3755 $   WS "#include <stdio.h>
3756 $   IF Has_Socketshr
3757 $   THEN WS "#include <socketshr.h>"
3758 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3759 $   ENDIF
3760 $   WS "int main()
3761 $   WS "{"
3762 $   WS "endprotoent();
3763 $   WS "exit(0);
3764 $   WS "}"
3765 $   CS
3766 $   tmp = "endprotoent"
3767 $   GOSUB inlibc
3768 $   d_endpent = tmp
3769 $ ELSE
3770 $   d_endpent="undef"
3771 $ ENDIF
3772 $!
3773 $! Check for endservent
3774 $!
3775 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3776 $ THEN
3777 $   OS
3778 $   WS "#ifdef __DECC
3779 $   WS "#include <stdlib.h>
3780 $   WS "#endif
3781 $   WS "#include <stdio.h>
3782 $   IF Has_Socketshr
3783 $   THEN WS "#include <socketshr.h>"
3784 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3785 $   ENDIF
3786 $   WS "int main()
3787 $   WS "{"
3788 $   WS "endservent();
3789 $   WS "exit(0);
3790 $   WS "}"
3791 $   CS
3792 $   tmp = "endservent"
3793 $   GOSUB inlibc
3794 $   d_endsent = tmp
3795 $ ELSE
3796 $   d_endsent="undef"
3797 $ ENDIF
3798 $!
3799 $! Check for sethostent
3800 $!
3801 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3802 $ THEN
3803 $   OS
3804 $   WS "#ifdef __DECC
3805 $   WS "#include <stdlib.h>
3806 $   WS "#endif
3807 $   WS "#include <stdio.h>
3808 $   IF Has_Socketshr
3809 $   THEN WS "#include <socketshr.h>"
3810 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3811 $   ENDIF
3812 $   WS "int main()
3813 $   WS "{"
3814 $   WS "sethostent(1);
3815 $   WS "exit(0);
3816 $   WS "}"
3817 $   CS
3818 $   tmp = "sethostent"
3819 $   GOSUB inlibc
3820 $   d_sethent = tmp
3821 $ ELSE
3822 $   d_sethent="undef"
3823 $ ENDIF
3824 $!
3825 $! Check for setnetent
3826 $!
3827 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3828 $ THEN
3829 $   OS
3830 $   WS "#ifdef __DECC
3831 $   WS "#include <stdlib.h>
3832 $   WS "#endif
3833 $   WS "#include <stdio.h>
3834 $   IF Has_Socketshr
3835 $   THEN WS "#include <socketshr.h>"
3836 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3837 $   ENDIF
3838 $   WS "int main()
3839 $   WS "{"
3840 $   WS "setnetent(1);
3841 $   WS "exit(0);
3842 $   WS "}"
3843 $   CS
3844 $   tmp = "setnetent"
3845 $   GOSUB inlibc
3846 $   d_setnent = tmp
3847 $ ELSE
3848 $   d_setnent="undef"
3849 $ ENDIF
3850 $!
3851 $! Check for setprotoent
3852 $!
3853 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3854 $ THEN
3855 $   OS
3856 $   WS "#ifdef __DECC
3857 $   WS "#include <stdlib.h>
3858 $   WS "#endif
3859 $   WS "#include <stdio.h>
3860 $   IF Has_Socketshr
3861 $   THEN WS "#include <socketshr.h>"
3862 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3863 $   ENDIF
3864 $   WS "int main()
3865 $   WS "{"
3866 $   WS "setprotoent(1);
3867 $   WS "exit(0);
3868 $   WS "}"
3869 $   CS
3870 $   tmp = "setprotoent"
3871 $   GOSUB inlibc
3872 $   d_setpent = tmp
3873 $ ELSE
3874 $   d_setpent="undef"
3875 $ ENDIF
3876 $!
3877 $! Check for setservent
3878 $!
3879 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3880 $ THEN
3881 $   OS
3882 $   WS "#ifdef __DECC
3883 $   WS "#include <stdlib.h>
3884 $   WS "#endif
3885 $   WS "#include <stdio.h>
3886 $   IF Has_Socketshr
3887 $   THEN WS "#include <socketshr.h>"
3888 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3889 $   ENDIF
3890 $   WS "int main()
3891 $   WS "{"
3892 $   WS "setservent(1);
3893 $   WS "exit(0);
3894 $   WS "}"
3895 $   CS
3896 $   tmp = "setservent"
3897 $   GOSUB inlibc
3898 $   d_setsent = tmp
3899 $ ELSE
3900 $   d_setsent="undef"
3901 $ ENDIF
3902 $!
3903 $! Check for gethostent
3904 $!
3905 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3906 $ THEN
3907 $   OS
3908 $   WS "#ifdef __DECC
3909 $   WS "#include <stdlib.h>
3910 $   WS "#endif
3911 $   WS "#include <stdio.h>
3912 $   IF Has_Socketshr
3913 $   THEN WS "#include <socketshr.h>"
3914 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3915 $   ENDIF
3916 $   WS "int main()
3917 $   WS "{"
3918 $   WS "gethostent();
3919 $   WS "exit(0);
3920 $   WS "}"
3921 $   CS
3922 $   tmp = "gethostent"
3923 $   GOSUB inlibc
3924 $   d_gethent = tmp
3925 $ ELSE
3926 $   d_gethent="undef"
3927 $ ENDIF
3928 $!
3929 $! Check for getnetent
3930 $!
3931 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3932 $ THEN
3933 $   OS
3934 $   WS "#ifdef __DECC
3935 $   WS "#include <stdlib.h>
3936 $   WS "#endif
3937 $   WS "#include <stdio.h>
3938 $   IF Has_Socketshr
3939 $   THEN WS "#include <socketshr.h>"
3940 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3941 $   ENDIF
3942 $   WS "int main()
3943 $   WS "{"
3944 $   WS "getnetent();
3945 $   WS "exit(0);
3946 $   WS "}"
3947 $   CS
3948 $   tmp = "getnetent"
3949 $   GOSUB inlibc
3950 $   d_getnent = tmp
3951 $ ELSE
3952 $   d_getnent="undef"
3953 $ ENDIF
3954 $!
3955 $! Check for getprotoent
3956 $!
3957 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3958 $ THEN
3959 $   OS
3960 $   WS "#ifdef __DECC
3961 $   WS "#include <stdlib.h>
3962 $   WS "#endif
3963 $   WS "#include <stdio.h>
3964 $   IF Has_Socketshr
3965 $   THEN WS "#include <socketshr.h>"
3966 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3967 $   ENDIF
3968 $   WS "int main()
3969 $   WS "{"
3970 $   WS "getprotoent();
3971 $   WS "exit(0);
3972 $   WS "}"
3973 $   CS
3974 $   tmp = "getprotoent"
3975 $   GOSUB inlibc
3976 $   d_getpent = tmp
3977 $ ELSE
3978 $   d_getpent="undef"
3979 $ ENDIF
3980 $!
3981 $! Check for getservent
3982 $!
3983 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3984 $ THEN
3985 $   OS
3986 $   WS "#ifdef __DECC
3987 $   WS "#include <stdlib.h>
3988 $   WS "#endif
3989 $   WS "#include <stdio.h>
3990 $   IF Has_Socketshr
3991 $   THEN WS "#include <socketshr.h>"
3992 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
3993 $   ENDIF
3994 $   WS "int main()
3995 $   WS "{"
3996 $   WS "getservent();
3997 $   WS "exit(0);
3998 $   WS "}"
3999 $   CS
4000 $   tmp = "getservent"
4001 $   GOSUB inlibc
4002 $   d_getsent = tmp
4003 $ ELSE
4004 $   d_getsent="undef"
4005 $ ENDIF
4006 $!
4007 $! Check for socklen_t
4008 $!
4009 $ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4010 $ THEN
4011 $   echo4 "Checking to see if you have socklen_t..."
4012 $   OS
4013 $   WS "#ifdef __DECC
4014 $   WS "#include <stdlib.h>
4015 $   WS "#endif
4016 $   WS "#include <stdio.h>
4017 $   IF Has_Socketshr
4018 $   THEN WS "#include <socketshr.h>"
4019 $   ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>
4020 $   ENDIF
4021 $   WS "int main()
4022 $   WS "{"
4023 $   WS "socklen_t x = 16;
4024 $   WS "exit(0);
4025 $   WS "}"
4026 $   CS
4027 $   GOSUB link_ok
4028 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4029 $   THEN
4030 $     d_socklen_t="define"
4031 $     echo "You have socklen_t."
4032 $   ELSE
4033 $     d_socklen_t="undef"
4034 $     echo "You do not have socklen_t."
4035 $   ENDIF
4036 $ ELSE
4037 $   d_socklen_t="undef"
4038 $ ENDIF
4039 $!
4040 $! Check for pthread_yield
4041 $!
4042 $ IF use_threads
4043 $ THEN
4044 $   OS
4045 $   WS "#ifdef __DECC
4046 $   WS "#include <stdlib.h>
4047 $   WS "#endif
4048 $   WS "#include <pthread.h>
4049 $   WS "#include <stdio.h>
4050 $   WS "int main()
4051 $   WS "{"
4052 $   WS "pthread_yield();
4053 $   WS "exit(0);
4054 $   WS "}"
4055 $   CS
4056 $   tmp = "pthread_yield"
4057 $   GOSUB inlibc
4058 $   d_pthread_yield = tmp
4059 $ ELSE
4060 $   d_pthread_yield="undef"
4061 $ ENDIF
4062 $!
4063 $! Check for sched_yield
4064 $!
4065 $ IF use_threads
4066 $ THEN
4067 $   OS
4068 $   WS "#ifdef __DECC
4069 $   WS "#include <stdlib.h>
4070 $   WS "#endif
4071 $   WS "#include <pthread.h>
4072 $   WS "#include <stdio.h>
4073 $   WS "int main()
4074 $   WS "{"
4075 $   WS "sched_yield();
4076 $   WS "exit(0);
4077 $   WS "}"
4078 $   CS
4079 $   tmp = "sched_yield"
4080 $   GOSUB inlibc
4081 $   d_sched_yield = tmp
4082 $   IF d_sched_yield .EQS. "define"
4083 $   THEN sched_yield = "sched_yield"
4084 $   ELSE sched_yield = " "
4085 $   ENDIF
4086 $ ELSE
4087 $   d_sched_yield="undef"
4088 $   sched_yield = " "
4089 $ ENDIF
4090 $!
4091 $! Check for generic pointer size
4092 $!
4093 $ echo4 "Checking to see how big your pointers are..." 
4094 $ OS
4095 $ WS "#ifdef __DECC
4096 $ WS "#include <stdlib.h>
4097 $ WS "#endif
4098 $ WS "#include <stdio.h>
4099 $ WS "int main()
4100 $ WS "{"
4101 $ WS "int foo;
4102 $ WS "foo = sizeof(char *);
4103 $ WS "printf(""%d\n"", foo);
4104 $ WS "exit(0);
4105 $ WS "}"
4106 $ CS
4107 $ tmp = "char *"
4108 $ GOSUB type_size_check
4109 $ ptrsize = tmp
4110 $ echo "Your pointers are ''ptrsize' bytes long."
4111 $!
4112 $! Check for size_t size
4113 $!
4114 $ tmp = "size_t"
4115 $ zzz = tmp
4116 $ echo4 "Checking the size of ''zzz'..."
4117 $ GOSUB type_size_check
4118 $ sizesize = tmp
4119 $ echo "Your ''zzz' size is ''sizesize' bytes."
4120 $!
4121 $! Check rand48 and its ilk
4122 $!
4123 $ echo4 "Looking for a random number function..."
4124 $ OS
4125 $ WS "#ifdef __DECC
4126 $ WS "#include <stdlib.h>
4127 $ WS "#endif
4128 $ WS "#include <stdio.h>
4129 $ WS "int main()
4130 $ WS "{"
4131 $ WS "srand48(12L);"
4132 $ WS "exit(0);
4133 $ WS "}"
4134 $ CS
4135 $ GOSUB link_ok
4136 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4137 $ THEN
4138 $   drand01 = "drand48()"
4139 $   randseedtype = "long int"
4140 $   seedfunc = "srand48"
4141 $   echo4 "Good, found drand48()."
4142 $   d_drand48proto = "define"
4143 $ ELSE
4144 $   d_drand48proto = "undef"
4145 $   drand01="random()"
4146 $   randseedtype = "unsigned"
4147 $   seedfunc = "srandom"
4148 $   OS
4149 $   WS "#ifdef __DECC
4150 $   WS "#include <stdlib.h>
4151 $   WS "#endif
4152 $   WS "#include <stdio.h>
4153 $   WS "int main()
4154 $   WS "{"
4155 $   WS "srandom(12);"
4156 $   WS "exit(0);
4157 $   WS "}"
4158 $   CS
4159 $   GOSUB link_ok
4160 $   IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4161 $   THEN
4162 $     echo4 "OK, found random()."
4163 $   ELSE
4164 $     drand01="(((float)rand())/((float)RAND_MAX))"
4165 $     randseedtype = "unsigned"
4166 $     seedfunc = "srand"
4167 $     echo4 "Yick, looks like I have to use rand()."
4168 $   ENDIF
4169 $ ENDIF
4170 $!
4171 $! Done with compiler checks. Clean up.
4172 $ IF F$SEARCH("try.c")  .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
4173 $ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
4174 $ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
4175 $ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
4176 $ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
4177 $ IF using_cxx
4178 $ THEN
4179 $   CALL Cxx_demangler_cleanup
4180 $ ENDIF
4181 $!
4182 $! Some that are compiler or VMS version sensitive
4183 $!
4184 $! Gnu C stuff
4185 $ IF Using_Gnu_C
4186 $ THEN
4187 $   d_attribut="define"
4188 $   vms_cc_type="gcc"
4189 $ ELSE
4190 $   vms_cc_type="cc"
4191 $   d_attribut="undef"
4192 $ ENDIF
4193 $!
4194 $! Dec C >= 5.2 and VMS ver >= 7.0
4195 $ IF (Using_Dec_C).AND.(F$INTEGER(Dec_C_Version).GE.50200000).AND.(vms_ver .GES. "7.0")
4196 $ THEN
4197 $   d_bcmp="define"
4198 $   d_gettimeod="define"
4199 $   d_uname="define"
4200 $   d_sigaction="define"
4201 $   d_truncate="define"
4202 $   d_wait4="define"
4203 $   d_index="define"
4204 $   pidtype="pid_t"
4205 $   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2 SPARE18 SPARE19 CHLD CONT STOP TSTP TTIN TTOU DEBUG SPARE27 SPARE28 SPARE29 SPARE30 SPARE31 SPARE32 RTMIN RTMAX"",0"
4206 $   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4207 $   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",""SPARE18"",""SPARE19"",""CHLD"",""CONT"",""STOP"",""TSTP"","
4208 $   psnwc3="""TTIN"",""TTOU"",""DEBUG"",""SPARE27"",""SPARE28"",""SPARE29"",""SPARE30"",""SPARE31"",""SPARE32"",""RTMIN"",""RTMAX"",0"
4209 $   sig_name_init = psnwc1 + psnwc2 + psnwc3
4210 $   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 64"","0"
4211 $   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,18,19,20,21,22,23,24,25,26,27,28,29,30,31,32,33,64,0"
4212 $!   perl_sig_num_with_commas=sig_num_init
4213 $   uidtype="uid_t"
4214 $   d_pathconf="define"
4215 $   d_fpathconf="define"
4216 $   d_sysconf="define"
4217 $   d_sigsetjmp="define"
4218 $ ELSE
4219 $   pidtype="unsigned int"
4220 $   d_gettimeod="undef"
4221 $   d_bcmp="undef"
4222 $   d_uname="undef"
4223 $   d_sigaction="undef"
4224 $   d_truncate="undef"
4225 $   d_wait4="undef"
4226 $   d_index="undef"
4227 $   sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4228 $   psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4229 $   psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4230 $   sig_name_init = psnwc1 + psnwc2
4231 $   sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"",0"
4232 $   sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
4233 $!   perl_sig_num_with_commas=sig_num_init
4234 $   uidtype="unsigned int"
4235 $   d_pathconf="undef"
4236 $   d_fpathconf="undef"
4237 $   d_sysconf="undef"
4238 $   d_sigsetjmp="undef"
4239 $ ENDIF
4240 $!
4241 $! Dec C alone
4242 $ IF Using_Dec_C
4243 $ THEN
4244 $   d_mbstowcs="define"
4245 $   d_mbtowc="define"
4246 $   d_stdiobase="define"
4247 $   d_stdio_cnt_lval="define"
4248 $   d_stdio_ptr_lval="define"
4249 $   d_stdstdio="define"
4250 $   d_wcstombs="define"
4251 $   d_mblen="define"
4252 $   d_mktime="define"
4253 $   d_strcoll="define"
4254 $   d_strxfrm="define"
4255 $   d_wctomb="define"
4256 $   i_locale="define"
4257 $   d_locconv="define"
4258 $   d_setlocale="define"
4259 $   vms_cc_type="decc"
4260 $ ELSE
4261 $   d_mbstowcs="undef"
4262 $   d_mbtowc="undef"
4263 $   d_stdiobase="undef"
4264 $   d_stdio_cnt_lval="undef"
4265 $   d_stdio_ptr_lval="undef"
4266 $   d_stdstdio="undef"
4267 $   d_wcstombs="undef"
4268 $   d_mblen="undef"
4269 $   d_mktime="undef"
4270 $   d_strcoll="undef"
4271 $   d_strxfrm="undef"
4272 $   d_wctomb="undef"
4273 $   i_locale="undef"
4274 $   d_locconv="undef"
4275 $   d_setlocale="undef"
4276 $ ENDIF
4277 $!
4278 $! Sockets?
4279 $ if Has_Socketshr .OR. Has_Dec_C_Sockets
4280 $ THEN
4281 $   d_vms_do_sockets="define"
4282 $   d_htonl="define"
4283 $   d_socket="define"
4284 $   d_select="define"
4285 $   netdb_hlen_type="int"
4286 $   netdb_host_type="char *"
4287 $   netdb_name_type="char *"
4288 $   netdb_net_type="long"
4289 $   d_gethbyaddr="define"
4290 $   d_gethbyname="define"
4291 $   d_getnbyaddr="define"
4292 $   d_getnbyname="define"
4293 $   d_getpbynumber="define"
4294 $   d_getpbyname="define"
4295 $   d_getsbyport="define"
4296 $   d_getsbyname="define"
4297 $   d_gethostprotos="define"
4298 $   d_getnetprotos="define"
4299 $   d_getprotoprotos="define"
4300 $   d_getservprotos="define"
4301 $   IF Using_Dec_C
4302 $   THEN
4303 $     socksizetype="unsigned int"
4304 $   ELSE
4305 $     socksizetype="int *"
4306 $   ENDIF
4307 $ ELSE
4308 $   d_vms_do_sockets="undef"
4309 $   d_htonl="undef"
4310 $   d_socket="undef"
4311 $   d_select="undef"
4312 $   netdb_hlen_type="int"
4313 $   netdb_host_type="char *"
4314 $   netdb_name_type="char *"
4315 $   netdb_net_type="long"
4316 $   d_gethbyaddr="undef"
4317 $   d_gethbyname="undef"
4318 $   d_getnbyaddr="undef"
4319 $   d_getnbyname="undef"
4320 $   d_getpbynumber="undef"
4321 $   d_getpbyname="undef"
4322 $   d_getsbyport="undef"
4323 $   d_getsbyname="undef"
4324 $   d_gethostprotos="undef"
4325 $   d_getnetprotos="undef"
4326 $   d_getprotoprotos="undef"
4327 $   d_getservprotos="undef"
4328 $   socksizetype="undef"
4329 $ ENDIF
4330 $! Threads
4331 $ IF use_threads
4332 $ THEN
4333 $   usethreads="define"
4334 $   d_pthreads_created_joinable="define"
4335 $   if (vms_ver .GES. "7.0")
4336 $   THEN
4337 $     d_oldpthreads="undef"
4338 $   ELSE
4339 $     d_oldpthreads="define"
4340 $   ENDIF
4341 $ ELSE
4342 $   d_oldpthreads="undef"
4343 $   usethreads="undef"
4344 $   d_pthreads_created_joinable="undef"
4345 $ ENDIF
4346 $! 
4347 $! new (5.005_62++) typedefs for primitives
4348 $!
4349 $ echo "Choosing the C types to be used for Perl's internal types..."
4350 $ ivtype="long"
4351 $ uvtype="unsigned long"
4352 $ i8type="char"
4353 $ u8type="unsigned char"
4354 $ i16type="short"
4355 $ u16type="unsigned short"
4356 $ i32type="int"
4357 $ u32type="unsigned int"
4358 $ i64type="long long"
4359 $ u64type="unsigned long long"
4360 $ nvtype="double"
4361 $!
4362 $ IF use64bitint .OR. use64bitint .EQS. "define"
4363 $ THEN
4364 $   ivtype = "''i64type'"
4365 $   uvtype = "''u64type'"
4366 $   nvtype="long double"
4367 $ ELSE
4368 $   i64size="undef"
4369 $   u64size="undef"
4370 $ ENDIF
4371 $!
4372 $ tmp = "''ivtype'"
4373 $ GOSUB type_size_check
4374 $ ivsize = tmp
4375 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
4376 $ IF ivtype .eqs. "long"
4377 $ THEN longsize = tmp
4378 $ ELSE
4379 $   tmp = "long"
4380 $   GOSUB type_size_check
4381 $   longsize = tmp
4382 $ ENDIF
4383 $
4384 $ tmp = "''uvtype'"
4385 $ GOSUB type_size_check
4386 $ uvsize = tmp
4387 $ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
4388 $
4389 $ tmp = "''i8type'"
4390 $ GOSUB type_size_check
4391 $ i8size = tmp
4392 $
4393 $ tmp = "''u8type'"
4394 $ GOSUB type_size_check
4395 $ u8size = tmp
4396 $
4397 $ tmp = "''i16type'"
4398 $ GOSUB type_size_check
4399 $ i16size = tmp
4400 $ IF i16type .eqs. "short"
4401 $ THEN shortsize = tmp
4402 $ ELSE
4403 $   tmp = "short"
4404 $   gosub type_size_check
4405 $   shortsize = tmp
4406 $ ENDIF
4407 $
4408 $ tmp = "''u16type'"
4409 $ GOSUB type_size_check
4410 $ u16size = tmp
4411 $
4412 $ tmp = "''i32type'"
4413 $ GOSUB type_size_check
4414 $ i32size = tmp
4415 $ IF i32type .eqs. "int"
4416 $ THEN intsize = tmp
4417 $ ELSE
4418 $   tmp = "int"
4419 $   gosub type_size_check
4420 $   intsize = tmp
4421 $ ENDIF
4422 $
4423 $ tmp = "''u32type'"
4424 $ gosub type_size_check
4425 $ u32size = tmp
4426 $
4427 $ tmp = "''nvtype'"
4428 $ GOSUB type_size_check
4429 $ nvsize = tmp
4430 $!
4431 $ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
4432 $ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
4433 $ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
4434 $!
4435 $ echo4 "Checking whether your NVs can preserve your UVs..."
4436 $ OS
4437 $ WS "#ifdef __DECC
4438 $ WS "#include <stdlib.h>
4439 $ WS "#endif
4440 $ WS "#include <stdio.h>
4441 $ WS "int main() {
4442 $ WS "    ''uvtype' k = (''uvtype')~0, l;
4443 $ WS "    ''nvtype' d;
4444 $ WS "    l = k;
4445 $ WS "    d = (''nvtype')l;
4446 $ WS "    l = (''uvtype')d;
4447 $ WS "    if (l == k)
4448 $ WS "       printf(""preserve\n"");
4449 $ WS "    exit(0);
4450 $ WS "}
4451 $ CS
4452 $ GOSUB compile
4453 $ IF tmp .EQS. "preserve"
4454 $ THEN 
4455 $   d_nv_preserves_uv = "define"
4456 $   echo "Yes, they can." 
4457 $   d_nv_preserves_uv_bits = F$STRING(F$INTEGER(uvsize) * 8)
4458 $ ELSE
4459 $   d_nv_preserves_uv = "undef"
4460 $   echo "No, they can't."
4461 $   echo4 "Checking how many bits of your UVs your NVs can preserve..."
4462 $   OS
4463 $   WS "#ifdef __DECC
4464 $   WS "#include <stdlib.h>
4465 $   WS "#endif
4466 $   WS "#include <stdio.h>
4467 $   WS "int main() {
4468 $   WS "    ''uvtype' u = 0;
4469 $   WS "    int     n = 8 * ''uvsize';
4470 $   WS "    int     i;
4471 $   WS "    for (i = 0; i < n; i++) {
4472 $   WS "      u = u << 1 | (''uvtype')1;
4473 $   WS "      if ((''uvtype')(''nvtype')u != u)
4474 $   WS "        break;
4475 $   WS "    }
4476 $   WS "    printf(""%d\n"", i);
4477 $   WS "    exit(0);
4478 $   WS "}
4479 $   GOSUB compile
4480 $   d_nv_preserves_uv_bits = tmp
4481 $ ENDIF
4482 $ DELETE/SYMBOL tmp
4483 $!
4484 $ ivdformat="""ld"""
4485 $ uvuformat="""lu"""
4486 $ uvoformat="""lo"""
4487 $ uvxformat="""lx"""
4488 $! uselongdouble?
4489 $ nveformat="""e"""
4490 $ nvfformat="""f"""
4491 $ nvgformat="""g"""
4492 $! 
4493 $! Finally the composite ones. All config
4494 $!
4495 $ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
4496 $!
4497 $ IF Using_Dec_C
4498 $ THEN
4499 $   ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext'/NoList''ccflags'"
4500 $ ENDIF
4501 $ IF use_vmsdebug_perl
4502 $ THEN
4503 $   optimize="/Debug/NoOpt"
4504 $   dbgprefix = "DBG"
4505 $ ELSE
4506 $   optimize= ""
4507 $   dbgprefix = ""
4508 $ ENDIF
4509 $!
4510 $! Okay, we've got everything configured. Now go write out a config.sh.
4511 $ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
4512 $ echo4 "Creating ''basename_config_sh'..."
4513 $ open/write CONFIG 'config_sh
4514 $ WC := write CONFIG
4515 $!
4516 $! ##BEGIN WRITE NEW CONSTANTS HERE##
4517 $!
4518 $ WC "#!/bin/sh"
4519 $ WC "#"
4520 $ WC "# This file was produced by Configure.COM on a ''osname' system."
4521 $ WC "#"
4522 $ WC "# Package name      : ''package'"
4523 $ WC "# Source directory  : ''src'"
4524 $ WC "# Configuration time: " + cf_time
4525 $ WC "# Configuration by  : " + cf_by
4526 $ WC "# Target system     : " + myuname
4527 $ WC ""
4528 $ WC "CONFIG='true'"
4529 $ WC "Makefile_SH='" + Makefile_SH + "'"
4530 $ WC "Mcc='" + Mcc + "'"
4531 $! WC "PERL_SUBVERSION='" + subversion + "'" ! VMS specific to descrip_mms.template
4532 $ WC "PERL_VERSION='" + patchlevel + "'" ! VMS specific to descrip_mms.template
4533 $ WC "alignbytes='" + alignbytes + "'"
4534 $ WC "aphostname='" + "'"
4535 $ WC "ar='" + "'"
4536 $ WC "archlib='" + archlib + "'"
4537 $ WC "archlibexp='" + archlibexp + "'"
4538 $ WC "archname='" + archname + "'"
4539 $ WC "baserev='" + baserev + "'"
4540 $ WC "bin='" + bin + "'"
4541 $ WC "binexp='" + binexp + "'"
4542 $ WC "builddir='" + builddir + "'"
4543 $ WC "byteorder='1234'"
4544 $ WC "castflags='0'"
4545 $ WC "cc='" + perl_cc + "'"
4546 $ WC "cccdlflags='" + cccdlflags + "'"
4547 $ WC "ccdlflags='" + ccdlflags + "'"
4548 $ WC "ccflags='" + ccflags + "'"
4549 $ WC "ccversion='" + ccversion + "'" ! VMS specific, oddly enough
4550 $ WC "cf_by='" + cf_by + "'"
4551 $ WC "cf_email='" + cf_email + "'"
4552 $ WC "cf_time='" + cf_time + "'"
4553 $ WC "config_args='" + config_args + "'"
4554 $ WC "config_sh='" + config_sh + "'"
4555 $ WC "cpp_stuff='" + cpp_stuff + "'"
4556 $ WC "cpplast='" + cpplast + "'"
4557 $ WC "cppminus='" + cppminus + "'"
4558 $ WC "cpprun='" + cpprun + "'"
4559 $ WC "cppstdin='" + cppstdin + "'"
4560 $ WC "crosscompile='undef'"
4561 $ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
4562 $ WC "d_PRId64='" + d_PRId64 + "'"
4563 $ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
4564 $ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
4565 $ WC "d_PRIo64='" + d_PRIo64 + "'"
4566 $ WC "d_PRIu64='" + d_PRIu64 + "'"
4567 $ WC "d_PRIx64='" + d_PRIx64 + "'"
4568 $ WC "d_access='" + d_access + "'"
4569 $ WC "d_accessx='undef'"
4570 $ WC "d_alarm='define'"
4571 $ WC "d_archlib='define'"
4572 $ WC "d_atolf='" + d_atolf + "'"
4573 $ WC "d_atoll='" + d_atoll + "'"
4574 $ WC "d_attribut='" + d_attribut + "'"
4575 $ WC "d_bcmp='" + d_bcmp + "'"
4576 $ WC "d_bcopy='" + d_bcopy + "'"
4577 $ WC "d_bincompat3='undef'"
4578 $ WC "d_bincompat5005='undef'"
4579 $ WC "d_bsdgetpgrp='undef'"
4580 $! WC "d_bsdpgrp='undef'"
4581 $ WC "d_bsdsetpgrp='undef'"
4582 $ WC "d_bzero='" + d_bzero + "'"
4583 $ WC "d_casti32='define'"
4584 $ WC "d_castneg='define'"
4585 $ WC "d_charvspr='undef'"
4586 $ WC "d_chown='define'"
4587 $ WC "d_chroot='undef'"
4588 $ WC "d_chsize='undef'"
4589 $ WC "d_cmsghdr_s='undef'"
4590 $ WC "d_const='define'"
4591 $ WC "d_crypt='define'"
4592 $ WC "d_csh='undef'"
4593 $ WC "d_cuserid='define'"
4594 $ WC "d_dbl_dig='define'"
4595 $ WC "d_difftime='define'"
4596 $ WC "d_dirnamlen='define'"
4597 $ WC "d_dlerror='undef'"
4598 $ WC "d_dlsymun='undef'"
4599 $ WC "d_dosuid='undef'"
4600 $ WC "d_drand48proto='" + d_drand48proto + "'"
4601 $ WC "d_dup2='define'"
4602 $ WC "d_eaccess='undef'"
4603 $ WC "d_endgrent='define'"
4604 $ WC "d_endhent='" + d_endhent + "'"
4605 $ WC "d_endnent='" + d_endnent + "'"
4606 $ WC "d_endpent='" + d_endpent + "'"
4607 $ WC "d_endpwent='define'"
4608 $ WC "d_endsent='" + d_endsent + "'"
4609 $ WC "d_eofnblk='undef'"
4610 $ WC "d_eunice='undef'"
4611 $ WC "d_fchmod='undef'"
4612 $ WC "d_fchown='undef'"
4613 $ WC "d_fcntl='" + d_fcntl + "'"
4614 $ WC "d_fd_set='" + d_fd_set + "'"
4615 $ WC "d_fgetpos='define'"
4616 $ WC "d_flexfnam='define'"
4617 $ WC "d_flock='undef'"
4618 $ WC "d_fork='undef'"
4619 $ WC "d_fpathconf='" + d_fpathconf + "'"
4620 $ WC "d_fpos64_t='" + d_fpos64_t + "'"
4621 $ WC "d_frexpl='" + d_frexpl + "'"
4622 $ WC "d_fs_data_s='undef'"
4623 $ WC "d_fseeko='undef'"
4624 $ WC "d_fsetpos='define'"
4625 $ WC "d_fstatfs='undef'"
4626 $ WC "d_fstatvfs='undef'"
4627 $ WC "d_ftello='undef'"
4628 $ WC "d_getcwd='undef'"
4629 $ WC "d_getespwnam='undef'"
4630 $ WC "d_getfsstat='undef'"
4631 $ WC "d_getgrent='define'"
4632 $ WC "d_getgrps='undef'"
4633 $ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
4634 $ WC "d_gethbyname='" + d_gethbyname + "'"
4635 $ WC "d_gethent='" + d_gethent + "'"
4636 $ WC "d_gethname='" + d_gethname + "'"
4637 $ WC "d_gethostprotos='" + d_gethostprotos + "'"
4638 $ WC "d_getlogin='define'"
4639 $ WC "d_getmnt='undef'"
4640 $ WC "d_getmntent='undef'"
4641 $ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
4642 $ WC "d_getnbyname='" + d_getnbyname + "'"
4643 $ WC "d_getnent='" + d_getnent + "'"
4644 $ WC "d_getnetprotos='" + d_getnetprotos + "'"
4645 $ WC "d_getpbyname='" + d_getpbyname + "'"
4646 $ WC "d_getpbynumber='" + d_getpbynumber + "'"
4647 $ WC "d_getpent='" + d_getpent + "'"
4648 $ WC "d_getpgid='undef'"
4649 $ WC "d_getpgrp2='undef'"
4650 $ WC "d_getpgrp='undef'"
4651 $ WC "d_getppid='undef'"
4652 $ WC "d_getprior='undef'"
4653 $ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
4654 $ WC "d_getprpwnam='undef'"
4655 $ WC "d_getpwent='define'"
4656 $ WC "d_getsbyname='" + d_getsbyname + "'"
4657 $ WC "d_getsbyport='" + d_getsbyport + "'"
4658 $ WC "d_getsent='" + d_getsent + "'"
4659 $ WC "d_getservprotos='" + d_getservprotos + "'"
4660 $ WC "d_getspnam='undef'"
4661 $ WC "d_gettimeod='" + d_gettimeod + "'"
4662 $ WC "d_gnulibc='undef'"
4663 $ WC "d_grpasswd='undef'"
4664 $ WC "d_hasmntopt='undef'"
4665 $ WC "d_htonl='" + d_htonl + "'"
4666 $ WC "d_iconv='" + d_iconv +"'"
4667 $ WC "d_index='" + d_index + "'"
4668 $ WC "d_inetaton='undef'"
4669 $ WC "d_int64_t='" + d_int64_t + "'"
4670 $ WC "d_isascii='define'"
4671 $ WC "d_isnan='define'"
4672 $ WC "d_isnanl='" + d_isnanl + "'"
4673 $ WC "d_killpg='undef'"
4674 $ WC "d_lchown='undef'"
4675 $ WC "d_ldbl_dig='define'"
4676 $ WC "d_link='undef'"
4677 $ WC "d_llseek='undef'"
4678 $ WC "d_locconv='" + d_locconv + "'"
4679 $ WC "d_lockf='undef'"
4680 $ WC "d_longdbl='" + d_longdbl + "'"
4681 $ WC "d_longlong='" + d_longlong + "'"
4682 $ WC "d_lseekproto='define'"
4683 $ WC "d_lstat='undef'"
4684 $ WC "d_madvise='undef'"
4685 $ WC "d_mblen='" + d_mblen + "'"
4686 $ WC "d_mbstowcs='" + d_mbstowcs + "'"
4687 $ WC "d_mbtowc='" + d_mbtowc + "'"
4688 $ WC "d_memchr='" + d_memchr + "'"
4689 $ WC "d_memcmp='define'"
4690 $ WC "d_memcpy='define'"
4691 $ WC "d_memmove='define'"
4692 $ WC "d_memset='define'"
4693 $ WC "d_mkdir='define'"
4694 $ WC "d_mkdtemp='" + d_mkdtemp + "'"
4695 $ WC "d_mkfifo='undef'"
4696 $ WC "d_mknod='undef'"
4697 $ WC "d_mkstemp='" + d_mkstemp + "'"
4698 $ WC "d_mkstemps='" + d_mkstemps + "'"
4699 $ WC "d_mktime='" + d_mktime + "'"
4700 $ WC "d_mmap='undef'"
4701 $ WC "d_modfl='" + d_modfl + "'"
4702 $ WC "d_mprotect='undef'"
4703 $ WC "d_msg='undef'"
4704 $ WC "d_msg_ctrunc='undef'"
4705 $ WC "d_msg_dontroute='undef'"
4706 $ WC "d_msg_oob='undef'"
4707 $ WC "d_msg_peek='undef'"
4708 $ WC "d_msg_proxy='undef'"
4709 $ WC "d_msghdr_s='undef'"
4710 $ WC "d_msync='undef'"
4711 $ WC "d_munmap='undef'"
4712 $ WC "d_mymalloc='" + d_mymalloc + "'"
4713 $ WC "d_nice='define'"
4714 $ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
4715 $ WC "d_nv_preserves_uv_bits='" + d_nv_preserves_uv_bits + "'"
4716 $ WC "d_off64_t='" + d_off64_t + "'"
4717 $ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
4718 $ WC "d_oldarchlib='define'"
4719 $ WC "d_oldpthreads='" + d_oldpthreads + "'"
4720 $ WC "d_open3='define'"
4721 $ WC "d_pathconf='" + d_pathconf + "'"
4722 $ WC "d_pause='define'"
4723 $ WC "d_perl_otherlibdirs='undef'"
4724 $ WC "d_phostname='undef'"
4725 $ WC "d_pipe='define'"
4726 $ WC "d_poll='undef'"
4727 $ WC "d_pthread_yield='" + d_pthread_yield + "'"
4728 $ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
4729 $ WC "d_pwage='undef'"
4730 $ WC "d_pwchange='undef'"
4731 $ WC "d_pwclass='undef'"
4732 $ WC "d_pwcomment='define'"
4733 $ WC "d_pwexpire='undef'"
4734 $ WC "d_pwgecos='define'"
4735 $ WC "d_pwpasswd='define'"
4736 $ WC "d_pwquota='undef'"
4737 $ WC "d_qgcvt='undef'"
4738 $ WC "d_quad='" + d_quad + "'"
4739 $ WC "d_readdir='define'"
4740 $ WC "d_readlink='undef'"
4741 $ WC "d_readv='undef'"
4742 $ WC "d_recvmsg='undef'"
4743 $ WC "d_rename='define'"
4744 $ WC "d_rewinddir='define'"
4745 $ WC "d_rmdir='define'"
4746 $ WC "d_safebcpy='undef'"
4747 $ WC "d_safemcpy='define'"
4748 $ WC "d_sanemcmp='define'"
4749 $ WC "d_sched_yield='" + d_sched_yield + "'"
4750 $ WC "d_scm_rights='undef'"
4751 $ WC "d_seekdir='define'"
4752 $ WC "d_select='" + d_select + "'"
4753 $ WC "d_sem='undef'"
4754 $ WC "d_semctl_semid_ds='undef'"
4755 $ WC "d_semctl_semun='undef'"
4756 $ WC "d_sendmsg='undef'"
4757 $ WC "d_setegid='undef'"
4758 $ WC "d_setenv='" + d_setenv + "'"
4759 $ WC "d_seteuid='undef'"
4760 $ WC "d_setgrent='undef'"
4761 $ WC "d_setgrps='undef'"
4762 $ WC "d_sethent='" + d_sethent + "'"
4763 $ WC "d_setlinebuf='undef'"
4764 $ WC "d_setlocale='" + d_setlocale + "'"
4765 $ WC "d_setnent='" + d_setnent + "'"
4766 $ WC "d_setpent='" + d_setpent + "'"
4767 $ WC "d_setpgid='undef'"
4768 $ WC "d_setpgrp2='undef'"
4769 $ WC "d_setpgrp='undef'"
4770 $ WC "d_setprior='undef'"
4771 $ WC "d_setproctitle='" + d_setproctitle + "'"
4772 $ WC "d_setpwent='define'"
4773 $ WC "d_setregid='undef'"
4774 $ WC "d_setresgid='undef'"
4775 $ WC "d_setresuid='undef'"
4776 $ WC "d_setreuid='undef'"
4777 $ WC "d_setrgid='undef'"
4778 $ WC "d_setruid='undef'"
4779 $ WC "d_setsent='" + d_setsent + "'"
4780 $ WC "d_setsid='undef'"
4781 $ WC "d_setvbuf='" + d_setvbuf + "'"
4782 $ WC "d_sfio='undef'"
4783 $ WC "d_shm='undef'"
4784 $ WC "d_shmatprototype='undef'"
4785 $ WC "d_sigaction='" + d_sigaction + "'"
4786 $ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
4787 $ WC "d_socket='" + d_socket + "'"
4788 $ WC "d_socklen_t='" + d_socklen_t + "'"
4789 $ WC "d_sockpair='undef'"
4790 $ WC "d_sqrtl='define'"
4791 $ WC "d_statblks='undef'"
4792 $ WC "d_statfs_f_flags='undef'"
4793 $ WC "d_statfs_s='undef'"
4794 $ WC "d_statfsflags='undef'"
4795 $ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
4796 $ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
4797 $ WC "d_stdio_stream_array='undef'"
4798 $ WC "d_stdiobase='" + d_stdiobase + "'"
4799 $ WC "d_stdstdio='" + d_stdstdio + "'"
4800 $ WC "d_strchr='define'"
4801 $ WC "d_strcoll='" + d_strcoll + "'"
4802 $ WC "d_strctcpy='define'"
4803 $ WC "d_strerrm='strerror((e),vaxc$errno)'"
4804 $ WC "d_strerror='define'"
4805 $ WC "d_strtod='define'"
4806 $ WC "d_strtol='define'"
4807 $ WC "d_strtold='" + d_strtold + "'"
4808 $ WC "d_strtoll='" + d_strtoll + "'"
4809 $ WC "d_strtoul='define'"
4810 $ WC "d_strtoull='" + d_strtoull + "'"
4811 $ WC "d_strtouq='" + d_strtouq + "'"
4812 $ WC "d_strxfrm='" + d_strxfrm  + "'"
4813 $ WC "d_suidsafe='undef'"
4814 $ WC "d_symlink='undef'"
4815 $ WC "d_syscall='undef'"
4816 $ WC "d_sysconf='" + d_sysconf + "'"
4817 $ WC "d_syserrlst='undef'"
4818 $ WC "d_system='define'"
4819 $ WC "d_tcgetpgrp='undef'"
4820 $ WC "d_tcsetpgrp='undef'"
4821 $ WC "d_telldir='define'"
4822 $ WC "d_telldirproto='define'"
4823 $ WC "d_times='define'"
4824 $ WC "d_truncate='" + d_truncate + "'"
4825 $ WC "d_tzname='undef'"
4826 $ WC "d_umask='define'"
4827 $ WC "d_uname='" + d_uname + "'"
4828 $ WC "d_union_semun='undef'"
4829 $ WC "d_unlink_all_versions='undef'"
4830 $ WC "d_ustat='undef'"
4831 $ WC "d_vendorarch='undef'"
4832 $ WC "d_vendorlib='undef'"
4833 $ WC "d_vfork='define'"
4834 $ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
4835 $ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
4836 $ WC "d_void_closedir='define'"
4837 $ WC "d_volatile='define'"
4838 $ WC "d_vprintf='define'"
4839 $ WC "d_wait4='" + d_wait4 + "'"
4840 $ WC "d_waitpid='define'"
4841 $ WC "d_wcstombs='" + d_wcstombs + "'"
4842 $ WC "d_wctomb='" + d_wctomb + "'"
4843 $ WC "d_writev='undef'"
4844 $ WC "db_hashtype=' '"
4845 $ WC "db_prefixtype=' '"
4846 $ WC "dbgprefix='" + dbgprefix + "'"
4847 $ WC "defvoidused='15'"
4848 $ WC "devtype='" + devtype + "'"
4849 $ WC "direntrytype='struct dirent'"
4850 $ WC "dlext='" + dlext + "'"
4851 $ WC "dlobj='" + dlobj + "'"
4852 $ WC "dlsrc='dl_vms.c'"
4853 $ WC "doublesize='" + doublesize + "'"
4854 $ WC "drand01='" + drand01 + "'"
4855 $ WC "dynamic_ext='" + extensions + "'"
4856 $ WC "eagain=' '"
4857 $ WC "ebcdic='undef'"
4858 $ WC "eunicefix=':'"
4859 $ WC "exe_ext='" + exe_ext + "'"
4860 $ WC "extensions='" + extensions + "'"
4861 $ WC "fflushNULL='define'"
4862 $ WC "fflushall='undef'"
4863 $ WC "fpostype='fpos_t'"
4864 $ WC "freetype='void'"
4865 $ WC "full_ar='" + "'"
4866 $ WC "full_csh='" + " '"
4867 $ WC "full_sed='_NLA0:'"
4868 $ WC "gccversion='" + gccversion + "'"
4869 $ WC "gidformat='lu'"
4870 $ WC "gidsign='1'"
4871 $ WC "gidsize='4'"
4872 $ WC "gidtype='" + gidtype + "'"
4873 $ WC "groupstype='Gid_t'"
4874 $ WC "hint='none'"
4875 $ WC "hintfile='" + "'"
4876 $ WC "i16size='" + i16size + "'"
4877 $ WC "i16type='" + i16type + "'"
4878 $ WC "i32size='" + i32size + "'"
4879 $ WC "i32type='" + i32type + "'"
4880 $ WC "i64size='" + i64size + "'"
4881 $ WC "i64type='" + i64type + "'"
4882 $ WC "i8size='" + i8size + "'"
4883 $ WC "i8type='" + i8type + "'"
4884 $ WC "i_arpainet='undef'"
4885 $ WC "i_dbm='undef'"
4886 $ WC "i_dirent='undef'"
4887 $ WC "i_dlfcn='undef'"
4888 $ WC "i_fcntl='" + i_fcntl + "'"
4889 $ WC "i_float='define'"
4890 $ WC "i_grp='undef'"
4891 $ WC "i_iconv='" + i_iconv +"'"
4892 $ WC "i_ieeefp='undef'"
4893 $ WC "i_inttypes='" + i_inttypes + "'"
4894 $ WC "i_libutil='" + i_libutil + "'"
4895 $ WC "i_limits='define'"
4896 $ WC "i_locale='" + i_locale + "'"
4897 $ WC "i_machcthr='undef'"
4898 $ WC "i_machcthreads='undef'"
4899 $ WC "i_math='define'"
4900 $ WC "i_memory='undef'"
4901 $ WC "i_mntent='undef'"
4902 $ WC "i_ndbm='undef'"
4903 $ WC "i_netdb='" + i_netdb + "'"
4904 $ WC "i_neterrno='define'"
4905 $ WC "i_netinettcp='" + i_netinettcp + "'"
4906 $ WC "i_niin='" + i_niin + "'"
4907 $ WC "i_poll='" + i_poll + "'"
4908 $ WC "i_prot='undef'"
4909 $ WC "i_pthread='define'"
4910 $ WC "i_pwd='undef'"
4911 $ WC "i_rpcsvcdbm='undef'"
4912 $ WC "i_sfio='undef'"
4913 $ WC "i_sgtty='undef'"
4914 $ WC "i_shadow='" + i_shadow + "'"
4915 $ WC "i_socks='" + i_socks + "'"
4916 $ WC "i_stdarg='define'"
4917 $ WC "i_stddef='define'"
4918 $ WC "i_stdlib='define'"
4919 $ WC "i_string='define'"
4920 $ WC "i_sunmath='undef'"
4921 $ WC "i_sysaccess='" + i_sysaccess + "'"
4922 $ WC "i_sysdir='undef'"
4923 $ WC "i_sysfile='" + i_sysfile + "'"
4924 $ WC "i_sysioctl='undef'"
4925 $ WC "i_syslog='" + i_syslog + "'"
4926 $ WC "i_sysmman='undef'"
4927 $ WC "i_sysmode='" + i_sysmode + "'"
4928 $ WC "i_sysmount='undef'"
4929 $ WC "i_sysndir='undef'"
4930 $ WC "i_sysparam='undef'"
4931 $ WC "i_sysresrc='undef'"
4932 $ WC "i_syssecrt='" + i_syssecrt + "'"
4933 $ WC "i_sysselct='undef'"
4934 $ WC "i_sysstat='define'"
4935 $ WC "i_sysstatfs='undef'"
4936 $ WC "i_sysstatvfs='undef'"
4937 $ WC "i_systime='undef'"
4938 $ WC "i_systimek='undef'"
4939 $ WC "i_systimes='undef'"
4940 $ WC "i_systypes='define'"
4941 $ WC "i_sysuio='" + i_sysuio + "'"
4942 $ WC "i_sysun='undef'"
4943 $ WC "i_sysutsname='" + i_sysutsname + "'"
4944 $ WC "i_sysvfs='undef'"
4945 $ WC "i_syswait='undef'"
4946 $ WC "i_termio='undef'"
4947 $ WC "i_termios='undef'"
4948 $ WC "i_time='define'"
4949 $ WC "i_unistd='" + i_unistd + "'"
4950 $ WC "i_ustat='undef'"
4951 $ WC "i_utime='undef'"
4952 $ WC "i_values='undef'"
4953 $ WC "i_varargs='undef'"
4954 $ WC "i_vfork='undef'"
4955 $ WC "inc_version_list='0'"
4956 $ WC "inc_version_list_init='0'"
4957 $ WC "installarchlib='" + installarchlib + "'"
4958 $ WC "installbin='" + installbin + "'"
4959 $ WC "installman1dir='" + installman1dir + "'"
4960 $ WC "installman3dir='" + installman3dir + "'"
4961 $ WC "installprivlib='" + installprivlib + "'"
4962 $ WC "installscript='" + installscript + "'"
4963 $ WC "installsitearch='" + installsitearch + "'"
4964 $ WC "installsitelib='" + installsitelib + "'"
4965 $ WC "installusrbinperl='undef'"
4966 $ WC "intsize='" + intsize + "'"
4967 $ WC "ivdformat='" + ivdformat + "'"
4968 $ WC "ivsize='" + ivsize + "'"
4969 $ WC "ivtype='" + ivtype + "'"
4970 $ WC "known_extensions='" + known_extensions + "'"
4971 $ WC "ld='" + ld + "'"
4972 $ WC "lddlflags='/Share'"
4973 $ WC "ldflags='/NoTrace/NoMap'"
4974 $ WC "lib_ext='" + lib_ext + "'"
4975 $ WC "libc='" + libc + "'"
4976 $ WC "libpth='/sys$share /sys$library'"
4977 $ WC "libs='" + libs + "'"
4978 $ WC "longdblsize='" + longdblsize + "'"
4979 $ WC "longlongsize='" + longlongsize + "'"
4980 $ WC "longsize='" + longsize + "'"
4981 $ WC "lseeksize='4'"
4982 $ WC "lseektype='int'"
4983 $ WC "mab='" + "'"
4984 $ WC "make='" + make + "'"
4985 $ WC "malloctype='void *'"
4986 $ WC "man1ext='rno'"
4987 $ WC "man3ext='rno'"
4988 $ WC "mmaptype='" + "'"
4989 $ WC "modetype='unsigned int'"
4990 $ WC "multiarch='undef'"
4991 $ WC "mydomain='" + mydomain + "'"
4992 $ WC "myhostname='" + myhostname + "'"
4993 $ WC "myuname='" + myuname + "'"
4994 $ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
4995 $ WC "netdb_host_type='" + netdb_host_type + "'"
4996 $ WC "netdb_name_type='" + netdb_name_type + "'"
4997 $ WC "netdb_net_type='" + netdb_net_type + "'"
4998 $ WC "nveformat='" + nveformat + "'"
4999 $ WC "nvfformat='" + nvfformat + "'"
5000 $ WC "nvgformat='" + nvgformat + "'"
5001 $ WC "nvsize='" + nvsize + "'"
5002 $ WC "nvtype='" + nvtype + "'"
5003 $ WC "o_nonblock=' '"
5004 $ WC "obj_ext='" + obj_ext + "'"
5005 $ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
5006 $ WC "oldarchlib='" + oldarchlib + "'"
5007 $ WC "oldarchlibexp='" + oldarchlibexp + "'"
5008 $ WC "optimize='" + optimize + "'"
5009 $ WC "osname='" + osname + "'"
5010 $ WC "osvers='" + osvers + "'"
5011 $ WC "otherlibdirs='" + "'"
5012 $ WC "package='" + package + "'"
5013 $ WC "pager='" + pager + "'"
5014 $ WC "patchlevel='" + patchlevel + "'"
5015 $ WC "path_sep='|'"
5016 $ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
5017 $ WC "perladmin='" + perladmin + "'"
5018 $ WC "pgflquota='" + pgflquota + "'"
5019 $ WC "pidtype='" + pidtype + "'"
5020 $ WC "pm_apiversion='" + version + "'"
5021 $! WC "prefix='" + vms_prefix + "'"
5022 $ WC "prefix='" + prefix + "'"
5023 $ WC "privlib='" + privlib + "'"
5024 $ WC "privlibexp='" + privlibexp + "'"
5025 $ WC "prototype='define'"
5026 $ WC "ptrsize='" + ptrsize + "'"
5027 $ WC "quadkind='" + quadkind + "'"
5028 $ WC "quadtype='" + quadtype + "'" 
5029 $ WC "randbits='31'"
5030 $ WC "randseedtype='" + randseedtype + "'"
5031 $ WC "ranlib='" + "'"
5032 $ WC "rd_nodata=' '"
5033 $ WC "revision='" + revision + "'"
5034 $! WC "sPRIEldbl='$sPRIEldbl'
5035 $! WC "sPRIFldbl='$sPRIFldbl'
5036 $! WC "sPRIGldbl='$sPRIGldbl'
5037 $! WC "sPRIX64='$sPRIX64'
5038 $ WC "sPRId64='" + sPRId64 + "'"
5039 $! WC "sPRIeldbl='" + sPRIeldbl + "'"
5040 $ WC "sPRIfldbl='" + sPRIfldbl + "'"
5041 $ WC "sPRIgldbl='" + sPRIgldbl + "'"
5042 $! WC "sPRIi64='" + sPRIi64 + "'"
5043 $ WC "sPRIo64='" + sPRIo64 + "'"
5044 $ WC "sPRIu64='" + sPRIu64 + "'"
5045 $ WC "sPRIx64='" + sPRIx64 + "'"
5046 $ WC "sched_yield='" + sched_yield + "'"
5047 $ WC "seedfunc='" + seedfunc + "'"
5048 $ WC "selectminbits='32'"
5049 $ WC "selecttype='" + selecttype + "'"
5050 $ WC "sh='MCR'"
5051 $ WC "shmattype='" + "'"
5052 $ WC "shortsize='" + shortsize + "'"
5053 $ WC "shrplib='define'"
5054 $ WC "sig_name='" + sig_name + "'"
5055 $ tmp = "sig_name_init='" + sig_name_init + "'"
5056 $ WC/symbol tmp
5057 $ DELETE/SYMBOL tmp
5058 $ WC "sig_num='" + sig_num + "'"
5059 $ WC "sig_num_init='" + sig_num_init + "'"
5060 $ WC "signal_t='" + signal_t + "'"
5061 $ WC "sitearch='" + sitearch + "'"
5062 $ WC "sitearchexp='" + sitearchexp + "'"
5063 $ WC "sitelib='" + sitelib + "'"
5064 $ WC "sitelib_stem='" + sitelib_stem + "'"
5065 $ WC "sitelibexp='" + sitelibexp + "'"
5066 $ WC "sizesize='" + sizesize + "'"
5067 $ WC "sizetype='size_t'"
5068 $ WC "so='" + so + "'"
5069 $ WC "socksizetype='" + socksizetype + "'"
5070 $ WC "spitshell='write sys$output '"
5071 $ WC "src='" + src + "'"
5072 $ WC "ssizetype='int'"
5073 $ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
5074 $ WC "static_ext='" + "'"
5075 $ WC "stdchar='" + stdchar + "'"
5076 $ WC "stdio_base='((*fp)->_base)'"
5077 $ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
5078 $ WC "stdio_cnt='((*fp)->_cnt)'"
5079 $ WC "stdio_ptr='((*fp)->_ptr)'"
5080 $ WC "stdio_stream_array='" + "'"
5081 $ WC "subversion='" + subversion + "'"
5082 $ WC "timetype='" + timetype + "'"
5083 $ WC "u16size='" + u16size + "'"
5084 $ WC "u16type='" + u16type + "'"
5085 $ WC "u32size='" + u32size + "'"
5086 $ WC "u32type='" + u32type + "'"
5087 $ WC "u64size='" + u64size + "'"
5088 $ WC "u64type='" + u64type + "'"
5089 $ WC "u8size='" + u8size + "'"
5090 $ WC "u8type='" + u8type + "'"
5091 $ WC "uidformat='lu'"
5092 $ WC "uidsign='1'"
5093 $ WC "uidsize='4'"
5094 $ WC "uidtype='" + uidtype + "'"
5095 $ WC "uquadtype='" + uquadtype + "'" 
5096 $ WC "use5005threads='" + use5005threads + "'"
5097 $ WC "use64bitall='" + use64bitall + "'"
5098 $ WC "use64bitint='" + use64bitint + "'"
5099 $ WC "usedl='" + usedl + "'"
5100 $ WC "useithreads='" + useithreads + "'"
5101 $ WC "uselargefiles='" + uselargefiles + "'"
5102 $ WC "uselongdouble='" + uselongdouble + "'"
5103 $ WC "usemorebits='" + usemorebits + "'"
5104 $ WC "usemultiplicity='" + usemultiplicity + "'"
5105 $ WC "usemymalloc='" + usemymalloc + "'"
5106 $ WC "useperlio='undef'"
5107 $ WC "useposix='false'"
5108 $ WC "usesocks='undef'"
5109 $ WC "usethreads='" + usethreads + "'"
5110 $ WC "usevfork='true'"
5111 $ WC "uvoformat='" + uvoformat + "'"
5112 $ WC "uvsize='" + uvsize + "'"
5113 $ WC "uvtype='" + uvtype + "'"
5114 $ WC "uvuformat='" + uvuformat + "'"
5115 $ WC "uvxformat='" + uvxformat + "'"
5116 $ WC "vendorarchexp='" + "'"
5117 $ WC "vendorlib_stem='" + "'"
5118 $ WC "vendorlibexp='" + "'"
5119 $ WC "version='" + version + "'"
5120 $ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
5121 $ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
5122 $ WC "vms_ver='" + vms_ver + "'" ! VMS specific
5123 $ WC "voidflags='15'"
5124 $ WC "xs_apiversion='" + version + "'"
5125 $ WC "CONFIGDOTSH='true'"
5126 $!
5127 $! ##END WRITE NEW CONSTANTS HERE##
5128 $!
5129 $ CLOSE CONFIG
5130 $!
5131 $! Okay, we've gotten here. Build munchconfig.exe
5132 $ COPY/NOLOG [-.vms]munchconfig.c []
5133 $ COPY/NOLOG [-.vms]'Makefile_SH []
5134 $ 'Perl_CC' munchconfig.c
5135 $ IF Needs_Opt
5136 $ THEN
5137 $   OPEN/WRITE CONFIG []munchconfig.opt
5138 $   IF Using_Gnu_C
5139 $   THEN
5140 $     WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
5141 $   ENDIF
5142 $   WRITE CONFIG "Sys$Share:VAXCRTL/Share"
5143 $   CLOSE CONFIG
5144 $   'ld' munchconfig.obj,munchconfig.opt/opt
5145 $   DELETE/NOLOG/NOCONFIRM munchconfig.opt;
5146 $ ELSE
5147 $   'ld' munchconfig.obj
5148 $ ENDIF
5149 $ IF F$SEARCH("munchconfig.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.obj;
5150 $ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
5151 $ IF using_cxx
5152 $ THEN
5153 $   CALL Cxx_demangler_cleanup
5154 $ ENDIF
5155 $!
5156 $ IF alldone .EQS. ""
5157 $ THEN
5158 $   cat4 SYS$INPUT:
5159
5160 If you'd like to make any changes to the config.sh file before I begin
5161 to configure things, answer yes to the following question.
5162
5163 $   dflt="n"
5164 $   rp="Do you wish to edit ''basename_config_sh'? [''dflt'] "
5165 $   GOSUB myread
5166 $   IF ans .EQS. "" then ans = dflt
5167 $   IF ans
5168 $   THEN
5169 $     echo4 ""
5170 $     echo4 "Be sure to type LOGOUT after you have edited the file,"
5171 $     echo4 "then this procedure will resume."
5172 $     echo4 ""
5173 $     default = F$ENVIRONMENT("DEFAULT")
5174 $     DIRECTORY 'config_sh
5175 $     SET DEFAULT [-]
5176 $     SPAWN/WAIT
5177 $     SET DEFAULT 'default
5178 $   ENDIF
5179 $ ENDIF
5180 $!
5181 $ echo ""
5182 $ echo4 "Adding ''osname' specific preprocessor commands."
5183 $ !
5184 $ ! we need an fdl file
5185 $ CREATE [-]CONFIG.FDL
5186 RECORD
5187   FORMAT STREAM_LF
5188 $ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
5189 $ ! First spit out the header info with the local defines (to get
5190 $ ! around the 255 character command line limit)
5191 $ OPEN/APPEND CONFIG [-]config.local
5192 $ IF use_debugging_perl THEN WC "#define DEBUGGING"
5193 $ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
5194 $ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
5195 $ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
5196 $ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
5197 $ IF Using_Gnu_C THEN WC "#define GNUC_ATTRIBUTE_CHECK"
5198 $ IF (Has_Dec_C_Sockets)
5199 $ THEN
5200 $    WC "#define VMS_DO_SOCKETS"
5201 $    WC "#define DECCRTL_SOCKETS"
5202 $ ELSE
5203 $    IF Has_Socketshr THEN WC "#define VMS_DO_SOCKETS"
5204 $ ENDIF
5205 $! This is VMS-specific for now
5206 $ WC "#''d_setenv' HAS_SETENV"
5207 $ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
5208 $ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
5209 $ IF use64bitint .OR. use64bitint .EQS. "define"
5210 $ THEN
5211 $   WC "#define USE_64_BIT_INT"
5212 $   WC "#define USE_LONG_DOUBLE"
5213 $ ENDIF
5214 $ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
5215     WC "#define USE_64_BIT_ALL"
5216 $ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
5217 $ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
5218 $ WC "#define HAS_ENVGETENV"
5219 $ WC "#define PERL_EXTERNAL_GLOB"
5220 $ CLOSE CONFIG
5221 $!
5222 $ echo4 "Doing variable substitutions on .SH files..."
5223 $ echo4 "Extracting config.h (with variable substitutions)"
5224 $!
5225 $! Now build the normal config.h
5226 $ DEFINE/USER_MODE sys$output [-]config.main
5227 $ mcr []munchconfig 'config_sh [-]config_h.sh
5228 $ ! Concatenate them together
5229 $ copy [-]config.local,[-]config.main [-]config.h
5230 $! Clean up
5231 $ DELETE/NOLOG [-]CONFIG.MAIN;*
5232 $ DELETE/NOLOG [-]CONFIG.LOCAL;*
5233 $ DELETE/NOLOG [-]CONFIG.FDL;*
5234 $!
5235 $ IF Using_Dec_C
5236 $ THEN
5237 $   DECC_REPLACE = "DECC=decc=1"
5238 $ ELSE
5239 $   DECC_REPLACE = "DECC=" 
5240 $ ENDIF
5241 $ IF Using_Gnu_C
5242 $ THEN
5243 $   GNUC_REPLACE = "GNUC=gnuc=1"
5244 $ ELSE
5245 $   GNUC_REPLACE = "GNUC=" 
5246 $ ENDIF
5247 $ IF Has_Dec_C_Sockets
5248 $ THEN
5249 $   SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
5250 $ ELSE
5251 $   IF Has_Socketshr
5252 $   THEN
5253 $     SOCKET_REPLACE = "SOCKET=SOCKETSHR_SOCKETS=1"
5254 $   ELSE
5255 $     SOCKET_REPLACE = "SOCKET="
5256 $   ENDIF
5257 $ ENDIF
5258 $ IF Use_Threads
5259 $ THEN
5260 $   IF (vms_ver .LES. "6.2")
5261 $   THEN
5262 $     THREAD_REPLACE = "THREAD=OLDTHREADED=1"
5263 $   ELSE
5264 $     THREAD_REPLACE = "THREAD=THREADED=1"
5265 $   ENDIF
5266 $ ELSE
5267 $   THREAD_REPLACE = "THREAD="
5268 $ ENDIF
5269 $ IF mymalloc
5270 $ THEN
5271 $   MALLOC_REPLACE = "MALLOC=MALLOC=1"
5272 $ ELSE
5273 $   MALLOC_REPLACE = "MALLOC="
5274 $ ENDIF
5275 $ echo4 "Extracting ''defmakefile' (with variable substitutions)"
5276 $ DEFINE/USER_MODE sys$output 'UUmakefile 
5277 $ mcr []munchconfig 'config_sh 'Makefile_SH "''DECC_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" "''THREAD_REPLACE'" -
5278 "''C_Compiler_Replace'" "''MALLOC_REPLACE'" "''Thread_Live_Dangerously'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'"
5279 $ echo4 "Extracting Build_Ext.Com (without variable substitutions)"
5280 $ Create Sys$Disk:[-]Build_Ext.Com
5281 $ Deck/Dollar="$EndOfTpl$"
5282 $!++ Build_Ext.Com
5283 $!   NOTE: This file is extracted as part of the VMS configuration process.
5284 $!   Any changes made to it directly will be lost.  If you need to make any
5285 $!   changes, please edit the template in [.vms]SubConfigure.Com instead.
5286 $    def = F$Environment("Default")
5287 $    exts1 = F$Edit(p1,"Compress")
5288 $    p2 = F$Edit(p2,"Upcase,Compress,Trim")
5289 $    If F$Locate("MCR ",p2).eq.0 Then p2 = F$Extract(3,255,p2)
5290 $    miniperl = "$" + F$Search(F$Parse(p2,".Exe"))
5291 $    makeutil = p3
5292 $    if f$type('p3') .nes. "" then makeutil = 'p3'
5293 $    targ = F$Edit(p4,"Lowercase")
5294 $    i = 0
5295 $ next_ext:
5296 $    ext = F$Element(i," ",p1)
5297 $    If ext .eqs. " " Then Goto done
5298 $    Define/User_mode Perl_Env_Tables CLISYM_LOCAL
5299 $    miniperl
5300      ($extdir = $ENV{'ext'}) =~ s/::/./g;
5301      $extdir =~ s#/#.#g;
5302      if ($extdir =~ /^vms/i) { $extdir =~ s/vms/.vms.ext/i; }
5303      else                    { $extdir = ".ext.$extdir";   }
5304      ($ENV{'extdir'} = "[$extdir]");
5305      ($ENV{'up'} = ('-') x ($extdir =~ tr/././));
5306 $    Set Default &extdir
5307 $    redesc = 0
5308 $    If F$Locate("clean",targ) .eqs. F$Length(targ)
5309 $    Then
5310 $      Write Sys$Output "Building ''ext' . . ."
5311 $      On Error Then Goto done
5312 $      If F$Search("Descrip.MMS") .eqs. ""
5313 $      Then
5314 $        redesc = 1
5315 $      Else
5316 $        If F$CvTime(F$File("Descrip.MMS","rdt")) .lts. -
5317             F$CvTime(F$File("Makefile.PL","rdt")) Then redesc = 1
5318 $      EndIf
5319 $    Else
5320 $      Write Sys$Output "''targ'ing ''ext' . . ."
5321 $      On Error Then Continue
5322 $    EndIf
5323 $    If redesc Then -
5324        miniperl "-I[''up'.lib]" Makefile.PL "INST_LIB=[''up'.lib]" "INST_ARCHLIB=[''up'.lib]"
5325 $    makeutil 'targ'
5326 $    i = i + 1
5327 $    Set Def &def
5328 $    Goto next_ext
5329 $ done:
5330 $    sts = $Status
5331 $    Set Def &def
5332 $    Exit sts
5333 $!-- Build_Ext.Com
5334 $EndOfTpl$
5335 $!
5336 $! Clean up after ourselves
5337 $ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
5338 $!
5339 $!  Warn of dangerous symbols or logical names
5340 $!
5341 $Bad_environment: SUBROUTINE
5342 $   Bad_env = ""
5343 $   IF p2 .eqs. "SYMBOL"
5344 $   THEN
5345 $     IF f$type('p1) .nes. "" THEN  Bad_env := SYMBOL
5346 $   ELSE
5347 $     IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
5348 $   ENDIF
5349 $   IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
5350 $   THEN
5351 $     IF f$search("config.msg") .nes. ""
5352 $     THEN
5353 $       OPEN/APPEND CONFIG config.msg
5354 $     ELSE
5355 $       OPEN/WRITE CONFIG config.msg
5356 $     ENDIF
5357 $     IF Bad_env .eqs. "SYMBOL"
5358 $     THEN
5359 $       WRITE CONFIG ""
5360 $       WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
5361 $       WRITE CONFIG " delete before building ''package' via:"
5362 $       WRITE CONFIG "     $ DELETE/SYMBOL/GLOBAL ''p1'"
5363 $       IF f$locate("""",&p1) .ge. f$length(&p1)
5364 $       THEN
5365 $       WRITE CONFIG " after building, testing, and installing ''package'
5366 $       WRITE CONFIG " restore the symbol with:"
5367 $       WRITE CONFIG "     $ ''p1' == """ + &p1 + """"
5368 $       ENDIF
5369 $     ENDIF
5370 $     IF Bad_env .eqs. "LOGICAL"
5371 $     THEN
5372 $       WRITE CONFIG ""
5373 $       WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
5374 $       WRITE CONFIG " deassign before building ''package'"
5375 $     ENDIF
5376 $     CLOSE CONFIG
5377 $     Bad_env = ""
5378 $   ENDIF
5379 $ EXIT
5380 $ ENDSUBROUTINE ! Bad_environment
5381 $ echo ""
5382 $ echo4 "Checking for dangerous pre-existing global symbols and logical names."
5383 $ CALL Bad_environment "TMP"
5384 $ CALL Bad_environment "LIB"
5385 $ CALL Bad_environment "T"
5386 $ CALL Bad_environment "FOO"
5387 $ CALL Bad_environment "EXT"
5388 $ CALL Bad_environment "TEST" "SYMBOL"
5389 $ IF f$search("config.msg") .eqs. "" THEN echo "OK."
5390 $!
5391 $! %Config-I-VMS, write perl_setup.com here
5392 $!
5393 $ IF (.NOT.perl_symbol)
5394 $ THEN
5395 $   file_2_find = "[-]''packageup'.cld"
5396 $   echo ""
5397 $   echo4 "The perl.cld file is now being written..."
5398 $   OPEN/WRITE CONFIG 'file_2_find'
5399 $   ext = ".exe"
5400 $   IF ((sharedperl) .AND. (F$GETSYI("HW_MODEL") .GE. 1024)) THEN ext := .AXE
5401 $   IF (use_vmsdebug_perl)
5402 $   THEN
5403 $     WRITE CONFIG "define verb dbgperl"
5404 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
5405 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
5406 $     WRITE CONFIG ""
5407 $     WRITE CONFIG "define verb perl"
5408 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
5409 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
5410 $   ELSE
5411 $     WRITE CONFIG "define verb perl"
5412 $     WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
5413 $     WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
5414 $   ENDIF
5415 $   CLOSE CONFIG
5416 $ ENDIF ! (.NOT.perl_symbol)
5417 $ echo ""
5418 $ echo4 "The perl_setup.com file is now being written..."
5419 $ file_2_find = "[-]perl_setup.com"
5420 $ OPEN/WRITE CONFIG 'file_2_find'
5421 $ WRITE CONFIG "$!"
5422 $ WRITE CONFIG "$! Perl_Setup.com    ''cf_time'"
5423 $ IF cf_email.NES.perladmin
5424 $ THEN
5425 $ WRITE CONFIG "$! perl configured by ''cf_email'"
5426 $ ELSE
5427 $ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
5428 $ ENDIF
5429 $ WRITE CONFIG "$!"
5430 $ prefix = prefix - "000000."
5431 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
5432     prefix = prefix - "]" + ".]" 
5433 $ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
5434 $ WRITE CONFIG "$ ext = "".exe"""
5435 $ IF sharedperl
5436 $ THEN
5437 $   write config "$ if f$getsyi(""HW_MODEL"") .ge. 1024 then ext = "".AXE"""
5438 $ ENDIF
5439 $ IF (perl_symbol)
5440 $ THEN
5441 $   IF (use_vmsdebug_perl)
5442 $   THEN
5443 $     WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgPerl'ext'"
5444 $     WRITE CONFIG "$ perl    :== $''vms_prefix':[000000]ndbgPerl'ext'"
5445 $     WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
5446 $   ELSE
5447 $     WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
5448 $     WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
5449 $   ENDIF
5450 $ ELSE ! .NOT.perl_symbol
5451 $   IF (use_vmsdebug_perl)
5452 $   THEN
5453 $     WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
5454 $   ELSE
5455 $     WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
5456 $   ENDIF
5457 $   IF perl_verb .EQS. "PROCESS"
5458 $   THEN
5459 $     WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
5460 $   ENDIF
5461 $ ENDIF !  perl_symbol
5462 $ WRITE CONFIG "$ define/nolog pod2text ''vms_prefix':[lib.pod]pod2text.com"
5463 $ WRITE CONFIG "$ define/nolog pod2html ''vms_prefix':[lib.pod]pod2html.com"
5464 $ WRITE CONFIG "$ define/nolog pod2man  ''vms_prefix':[lib.pod]pod2man.com"
5465 $!
5466 $ IF (tzneedset)
5467 $ THEN
5468 $ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
5469 $ ELSE    !leave in but commented out (in case setting was from perl :-)
5470 $ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
5471 $ ENDIF
5472 $ WRITE CONFIG "$!"
5473 $ WRITE CONFIG "$! Symbols for commonly used scripts:"
5474 $ WRITE CONFIG "$!"
5475 $ IF (perl_symbol)
5476 $ THEN
5477 $   WRITE CONFIG "$ Perldoc  == ""'"+"'Perl' ''vms_prefix':[lib.pod]Perldoc.com -t"""
5478 $   WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
5479 $   WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
5480 $   WRITE CONFIG "$ pod2latex == ""'"+"'Perl' ''vms_prefix':[lib.pod]pod2latex.com"""
5481 $   WRITE CONFIG "$!pod2man  == ""'"+"'Perl' pod2man"""
5482 $   WRITE CONFIG "$!Perlbug  == ""'"+"'Perl' ''vms_prefix':[lib]Perlbug.com"""
5483 $   WRITE CONFIG "$ c2ph     == ""'"+"'Perl' ''vms_prefix':[utils]c2ph.com"""
5484 $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
5485 $   THEN
5486 $     WRITE CONFIG "$ dprofpp     == ""'"+"'Perl' ''vms_prefix':[utils]dprofpp.com"""
5487 $   ENDIF 
5488 $   WRITE CONFIG "$ h2ph     == ""'"+"'Perl' ''vms_prefix':[utils]h2ph.com"""
5489 $   WRITE CONFIG "$ h2xs     == ""'"+"'Perl' ''vms_prefix':[utils]h2xs.com"""
5490 $   WRITE CONFIG "$!perlcc   == ""'"+"'Perl' ''vms_prefix':[utils]perlcc.com"""
5491 $   WRITE CONFIG "$ splain   == ""'"+"'Perl' ''vms_prefix':[utils]splain.com"""
5492 $ ELSE
5493 $   WRITE CONFIG "$ Perldoc  == ""Perl ''vms_prefix':[lib.pod]Perldoc.com -t"""
5494 $   WRITE CONFIG "$ pod2text == ""Perl pod2text"""
5495 $   WRITE CONFIG "$ pod2html == ""Perl pod2html"""
5496 $   WRITE CONFIG "$ pod2latex == ""Perl ''vms_prefix':[lib.pod]pod2latex.com"""
5497 $   WRITE CONFIG "$!pod2man  == ""Perl pod2man"""
5498 $   WRITE CONFIG "$!Perlbug  == ""Perl ''vms_prefix':[lib]Perlbug.com"""
5499 $   WRITE CONFIG "$ c2ph     == ""Perl ''vms_prefix':[utils]c2ph.com"""
5500 $   IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
5501 $   THEN
5502 $     WRITE CONFIG "$ dprofpp     == ""Perl ''vms_prefix':[utils]dprofpp.com"""
5503 $   ENDIF 
5504 $   WRITE CONFIG "$ h2ph     == ""Perl ''vms_prefix':[utils]h2ph.com"""
5505 $   WRITE CONFIG "$ h2xs     == ""Perl ''vms_prefix':[utils]h2xs.com"""
5506 $   WRITE CONFIG "$!perlcc   == ""Perl ''vms_prefix':[utils]perlcc.com"""
5507 $   WRITE CONFIG "$ splain   == ""Perl ''vms_prefix':[utils]splain.com"""
5508 $ ENDIF
5509 $ CLOSE CONFIG
5510 $!
5511 $ echo  ""
5512 $ echo  "The file can be found at:"
5513 $ echo4 "    ''F$SEARCH(file_2_find)'"
5514 $ echo  "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
5515 $ echo  "when you are satisfied with a successful compilation,"
5516 $ echo  "testing, and installation of your perl."
5517 $ echo  ""
5518 $ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
5519 $ THEN
5520 $   file_2_find = "[-]''packageup'_install.com"
5521 $   OPEN/WRITE CONFIG 'file_2_find
5522 $   WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
5523 $   WRITE CONFIG "    /output=sys$common:[syslib]dcltables.exe"
5524 $   WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
5525 $   CLOSE CONFIG
5526 $   echo4 ""
5527 $   echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
5528 $   echo4 "    @ ''F$SEARCH(file_2_find)'"
5529 $   echo4 "after a successful build, test, and install.  Do so with CMKRNL privilege."
5530 $   echo4 ""
5531 $ ENDIF
5532 $!
5533 $!figure out where we "are" by parsing 'vms_default_directory_name' 
5534 $!
5535 $ set_def_command = ""
5536 $ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]" 
5537 $ tmp = vms_default_directory_name - dflt - "]"
5538 $ i = 0
5539 $ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
5540 $Set_def_loop:
5541 $ tmp1 = F$ELEMENT(i,".",tmp)
5542 $ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
5543 $ IF i .EQ. 0 
5544 $ THEN set_def_command = "set default [-"
5545 $ ELSE set_def_command = set_def_command + "-"
5546 $ ENDIF
5547 $ i = i + 1
5548 $ GOTO Set_def_loop
5549 $Beyond_set_def_loop:
5550 $ IF set_def_command.NES.""
5551 $ THEN
5552 $   set_def_command = set_def_command - "-" + "]"
5553 $   echo4 ""
5554 $   echo4 "In order to build ''package' you must now issue the commands:"
5555 $   echo4 ""
5556 $   echo4 " ''set_def_command'"
5557 $ ELSE
5558 $   echo4 ""
5559 $   echo4 "In order to build ''package' you must now issue the command:"
5560 $   echo4 ""
5561 $ ENDIF
5562 $ echo4 " ''make'''makefile'", macros
5563 $ echo4 ""
5564 $!
5565 $ IF ( F$SEARCH("config.msg").NES."" ) 
5566 $ THEN
5567 $   echo "Hmm.  I also noted the following information while running:"
5568 $   echo ""
5569 $   type config.msg
5570 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
5571 $   DELETE/NOLOG/NOCONFIRM config.msg;
5572 $ ENDIF
5573 $!
5574 $Clean_up:
5575 $ IF (silent)
5576 $ THEN
5577 $   DEASSIGN SYS$OUTPUT
5578 $!   DEASSIGN SYS$ERROR
5579 $ ENDIF
5580 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt THEN CLOSE CONFIG
5581 $ IF F$GETJPI("","FILCNT").NE.vms_filcnt 
5582 $ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
5583 $ ENDIF
5584 $ dflt = F$ENVIRONMENT("DEFAULT")
5585 $ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
5586 $ THEN
5587 $   IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
5588 $   SET DEFAULT [-]
5589 $   SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
5590 $   DELETE/NOLOG/NOCONFIRM UU.DIR;
5591 $ ENDIF
5592 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
5593 $ STOP
5594 $ EXIT
5595 $!: End of Configure