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