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