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