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