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