This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Upgrade to podlators 1.17.
[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
d6ec9fa3 2501$ IF xxx .EQS. "Devel/PPPort/harness" THEN goto ext_loop ! sub extension - omit
a3bd614a
PP
2502$ IF F$EXTRACT(0,8,line) .EQS. "vms/ext/" THEN -
2503 xxx = "VMS/" + F$EXTRACT(8,line_len - 20,line)
2504$ known_extensions = known_extensions + " ''xxx'"
2505$ goto ext_loop
2506$end_ext:
2507$ close CONFIG
2508$ DELETE/SYMBOL xxx
2509$ known_extensions = F$EDIT(known_extensions,"TRIM,COMPRESS")
2510$ dflt = known_extensions
2511$ IF ccname .NES. "DEC" .AND. ccname .NES. "CXX"
2512$ THEN
2513$ dflt = dflt - "POSIX" ! not with VAX C or GCC
2514$ ENDIF
2515$ dflt = dflt - "ByteLoader" ! needs to be ported
2516$ dflt = dflt - "DB_File" ! needs to be ported
2517$ dflt = dflt - "GDBM_File" ! needs porting/special library
2518$ dflt = dflt - "IPC/SysV" ! needs to be ported
2519$ dflt = dflt - "NDBM_File" ! needs porting/special library
2520$ dflt = dflt - "ODBM_File" ! needs porting/special library
dab31494 2521$ dflt = dflt - "Sys/Syslog" ! needs porting/special library "GDBM_File macro LOG_DEBUG"
9b5878df
CB
2522$ IF .NOT. Has_socketshr .AND. .NOT. Has_Dec_C_Sockets
2523$ THEN
2524$ dflt = dflt - "Socket" ! optional on VMS
2525$ ENDIF
9b5c8979
JH
2526$ IF .NOT. use_ithreads THEN dflt = dflt - "threads/shared"
2527$ IF .NOT. use_ithreads THEN dflt = dflt - "threads"
a3bd614a
PP
2528$ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2529$!
97abc6ad
HM
2530$! Ask for their default list of extensions to build
2531$ echo ""
7558ebc2
PP
2532$ echo "It is time to specify which modules you want to build into"
2533$ echo "perl. Most of these are standard and should be chosen, though"
2534$ echo "you might, for example, want to build GDBM_File instead of"
2535$ echo "SDBM_File if you have the GDBM library built on your machine."
2536$ echo ""
97abc6ad 2537$ echo "Which modules do you want to build into perl?"
97abc6ad
HM
2538$ rp = "[''dflt'] "
2539$ GOSUB myread
a3bd614a 2540$ extensions = F$EDIT(ans,"TRIM,COMPRESS")
97abc6ad
HM
2541$!
2542$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2543$ echo ""
570bb66e 2544$ echo "Checking your ""make"" utilities..."
97abc6ad
HM
2545$! If the 'build' that you use is not here add it and it's test
2546$! switch to the _END_ of these strings (and increment max_build)
2547$! (e.g. builders = builders + "/FOOMAKE"
2548$! probers = probers + " -fooVersionSwitch"
2549$! ) & please let me know about it.
2550$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2551$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2552$ max_build = 7
2553$!
2554$ orig_dflt = "MMK"
2555$ default_set = ""
2556$ ok_builders = ""
2557$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2558$ WRITE CONFIG "dont_make_anything_yet:"
2559$ WRITE CONFIG F$FAO("!_")
2560$ CLOSE CONFIG
2561$ n = 0
2562$ messages = F$ENVIRONMENT("MESSAGE")
2563$Build_probe:
2564$ build = F$ELEMENT(n,"/",builders)
2565$ probe = F$ELEMENT(n,"!",probers)
2566$ echo "Testing whether you have ''build' on your system..."
570bb66e
JH
2567$!
2568$! Noted with GNU Make version 3.60 that the $status and $severity
2569$! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2570$! $SEVERITY == "4".
2571$!
a3ef2c6f
GS
2572$ SET NOON
2573$ ON CONTROL_Y THEN GOTO Reenable_messages_build
2574$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
97abc6ad 2575$ 'build' 'probe'
570bb66e 2576$ IF ($SEVERITY .EQ. 1) ! not adequate?
97abc6ad
HM
2577$ THEN
2578$ echo "OK."
2579$ IF (build .EQS. orig_dflt)
2580$ THEN
2581$ default_set = "TRUE"
2582$ dflt = build
2583$ ENDIF
2584$ ok_builders = ok_builders + " " + build
2585$ IF (.NOT. default_set) THEN dflt = build
2586$ ELSE
2587$ echo "Nope."
2588$ ENDIF
a3ef2c6f
GS
2589$Reenable_messages_build:
2590$ SET MESSAGE 'messages'
2591$ SET ON
9b5c8979 2592$ on control_y then goto clean_up
97abc6ad
HM
2593$ n = n + 1
2594$ IF (n .LT. max_build) THEN GOTO Build_probe
2595$!
2596$ echo ""
2597$ IF (ok_builders .NES. "")
2598$ THEN
2599$ echo "Here is the list of builders you can apparently use:"
2600$ echo "(",ok_builders," )"
a5fddd44 2601$ rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
97abc6ad
HM
2602$ GOSUB myread
2603$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2604$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2605$ IF (ans .EQS. "")
2606$ THEN build = dflt
2607$ ELSE build = ans
2608$ ENDIF
2609$ ELSE
2610$ TYPE SYS$INPUT:
7558ebc2 2611$ DECK
97abc6ad
HM
2612
2613%Config-E-VMS, ERROR:
2614 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2615 utility of some sort and after checking my "builders" list I cannot find
2616 the symbol or command you use on your system to compile programs.
2617
7558ebc2 2618$ EOD
570bb66e 2619$ READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
97abc6ad
HM
2620$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2621$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2622$ IF (ans .EQS. "")
2623$ THEN build = dflt
7558ebc2 2624$ echo "I do not know where ""make"" is, and my life depends on it."
97abc6ad
HM
2625$ echo "Go find a make program or fix your DCL$PATH setting!"
2626$ echo "ABORTING..."
2627$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2628$ STOP
2629$ EXIT 2 !$STATUS = "%X00000002" (error)
2630$ ELSE
2631$ build = ans
2632$ ENDIF
2633$ ENDIF
2634$!
2635$ DELETE/NOLOG Makefile.;
2636$ GOTO Beyond_open
2637$Open_error:
2638$ TYPE SYS$INPUT:
7558ebc2 2639$ DECK
97abc6ad
HM
2640
2641 There seems to be trouble. I just tried to create a file in
7558ebc2 2642$ EOD
97abc6ad
HM
2643$ echo4 'F$ENVIRONMENT("DEFAULT")'
2644$ TYPE SYS$INPUT:
7558ebc2 2645$ DECK
97abc6ad
HM
2646 but was unsuccessful. I am stopping now. Please check that directories'
2647 PROTECTION bits. I will leave you in the directory where you started
2648 Configure.com
7558ebc2 2649$ EOD
97abc6ad
HM
2650$ echo4 "ABORTING..."
2651$ GOTO Clean_up
2652$ STOP
2653$ EXIT
2654$!
2655$Beyond_open:
2656$! echo " Very well I will proceed with ""''build'"""
2657$ make = F$EDIT(build,"UPCASE")
2658$!
2659$!: locate the preferred pager for this system
2660$!pagers = "most|more|less|type/page"
dfe814dc
PP
2661$ dflt = "type/page"
2662$! assume that the presence of a most symbol indicates the presence
2663$! of the pager.
2664$ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
2665$ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
2666$ rp="What pager is used on your system? [''dflt'] "
2667$ GOSUB myread
9b5c8979 2668$ pager = ans
97abc6ad
HM
2669$!
2670$! update [.vms]config.vms here
2671$!
2672$! update makefile here
2673$! echo4 "Updating makefile..."
2674$!
2675$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2676$ THEN
08c7cbbb
GS
2677$ makefile = "" !wrt MANIFEST dir
2678$ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
2679$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
570bb66e 2680$ Makefile_SH = "descrip_mms.template"
97abc6ad 2681$ ELSE
08c7cbbb
GS
2682$ makefile = " -f Makefile." !wrt MANIFEST dir
2683$ UUmakefile = "[-]Makefile." !wrt CWD dir
2684$ DEFmakefile = "Makefile." !wrt DEF dir (?)
570bb66e 2685$ Makefile_SH = "Makefile.in"
97abc6ad
HM
2686$ ENDIF
2687$!
7558ebc2
PP
2688$ IF macros .NES. ""
2689$ THEN
97abc6ad
HM
2690$ tmp = F$LENGTH(macros)
2691$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2692$ macros = "/macro=(" + macros + ")"
2693$ ENDIF
498336ed
CB
2694$! Build up the extra C flags
2695$!
7558ebc2
PP
2696$ IF use_ieee_math
2697$ THEN
498336ed 2698$ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
7558ebc2
PP
2699$ ENDIF
2700$ IF be_case_sensitive
2701$ THEN
498336ed 2702$ extra_flags = "''extra_flags'" + "/Names=As_Is"
7558ebc2 2703$ ENDIF
498336ed 2704$ extra_flags = "''extra_flags'" + "''user_c_flags'"
97abc6ad 2705$!
570bb66e
JH
2706$ min_pgflquota = "100000"
2707$ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
2708$ IF pgflquota .LES. min_pgflquota
2709$ THEN
2710$ echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
2711$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
2712$ IF ans
2713$ THEN
2714$ echo4 "Continuing..."
2715$ ELSE
2716$ echo4 "ABORTING..."
2717$ GOTO Clean_up
2718$ ENDIF
2719$ ENDIF
97abc6ad 2720$!
c998f3c7
PP
2721$! PerlIO abstraction
2722$!
9b5c8979 2723$ bool_dflt = "y"
c998f3c7 2724$ IF F$TYPE(useperlio) .NES. ""
9b5c8979
JH
2725$ then
2726$ if f$extract(0,1,f$edit(useperlio,"collapse,upcase")) .eqs. "N" .or. useperlio .eqs. "undef" then bool_dflt = "n"
2727$ endif
c998f3c7
PP
2728$ IF .NOT. silent
2729$ THEN
5d8a6eb9 2730$ echo "Previous versions of ''package' used the standard IO mechanisms as"
c998f3c7
PP
2731$ TYPE SYS$INPUT:
2732$ DECK
2733defined in <stdio.h>. Versions 5.003_02 and later of perl allow
2734alternate IO mechanisms via the PerlIO abstraction layer, but the
5d8a6eb9
CB
2735stdio mechanism is still available if needed. The abstraction layer
2736can use AT&T's sfio (if you already have sfio installed) or regular stdio.
c998f3c7
PP
2737Using PerlIO with sfio may cause problems with some extension modules.
2738
2739$ EOD
9b5c8979 2740$ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
c998f3c7 2741$ ENDIF
9b5c8979 2742$ rp = "Use the PerlIO abstraction layer? [''bool_dflt'] "
c998f3c7 2743$ GOSUB myread
c998f3c7
PP
2744$ IF ans
2745$ THEN
2746$ useperlio = "define"
2747$ ELSE
2748$ echo "Ok, doing things the stdio way."
2749$ useperlio = "undef"
2750$ ENDIF
2751$!
97abc6ad 2752$ echo ""
570bb66e
JH
2753$ echo4 "Checking the C run-time library."
2754$!
56aeb0ae 2755$! Former SUBCONFIGURE.COM
570bb66e
JH
2756$!
2757$! - build a config.sh for VMS Perl.
2758$! - use built config.sh to take config_h.SH -> config.h
2759$! - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
2760$! vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
2761$! vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
570bb66e
JH
2762$!
2763$! Note for folks from other platforms changing things in here:
2764$!
2765$! Fancy changes (based on compiler capabilities or VMS version or
2766$! whatever) are tricky, so go ahead and punt on those.
2767$!
2768$! Simple changes, though (say, always setting something to 1, or undef,
2769$! or something like that) are straightforward. Adding a new constant
2770$! item for the ultimately created config.sh requires at least one
2771$! (possibly more) line(s) to this file.
2772$!
2773$! Add a line in the format:
2774$!
2775$! $ WC "foo='undef'"
2776$!
2777$! somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
2778$! and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
2779$! is sorted ASCII and corresponds to the output of config.sh in the
2780$! Bourne shell version of Configure).
2781$! Be very careful with quoting, as it can be tricky.
2782$! For example if instead of a constant string like 'undef' or 'define'
2783$! you wanted to add something to VMS's config.sh that looks like:
2784$!
2785$! blank_string=''
2786$!
2787$! then add a line that looks like this before the
2788$! '##END WRITE NEW CONSTANTS HERE##' tagged line:
2789$!
2790$! $ WC "blank_string='" + "'"
2791$!
2792$! (+ is the string concatenator and "''var'" has the effect
2793$! of "${var}" in perl or sh, but "'const'" is not interpolated).
2794$!
2795$! Note that unitialized variables, such as a line like:
2796$!
2797$! $ WC "new_var='" + new_var + "'"
2798$!
2799$! should be avoided unless new_var has a value assigned prior
2800$! to that line (think of perl's -w warnings).
2801$!
2802$! %DCL-W-UNDSYM, undefined symbol - check validity and spelling
2803$! \NEW_VAR\
2804$!
2805$!
2806$ vms_ver = F$EXTRACT(1,3, osvers)
2807$ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
2808$ MCC = f$edit(mcc, "UPCASE")
2809$ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
414b89cc 2810$ IF ccname .EQS. "DEC"
570bb66e
JH
2811$ THEN
2812$ Checkcc := "''Mcc'/prefix=all"
2813$ ELSE
414b89cc 2814$ IF ccname .EQS. "CXX"
570bb66e
JH
2815$ THEN
2816$ Checkcc := cxx
2817$ ELSE
2818$ Checkcc := "''Mcc'"
2819$ ENDIF
2820$ ENDIF
2821$ ccflags = ccflags + extra_flags
2822$ IF be_case_sensitive
2823$ THEN
2824$ d_vms_be_case_sensitive = "define"
2825$ ELSE
2826$ d_vms_be_case_sensitive = "undef"
2827$ ENDIF
2828$! Some constant defaults.
2829$ hwname = f$getsyi("HW_NAME")
2830$ myname = myhostname
2831$ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
2832$!
2833$ ccdlflags=""
2834$ cccdlflags=""
2835$!
2836$ IF use64bitint .OR. use64bitint .EQS. "define"
2837$ THEN
2838$ use64bitint = "define"
2839$ uselargefiles = "define"
2840$ uselongdouble = "define"
414b89cc 2841$ alignbytes="16"
570bb66e 2842$ usemorebits = "define"
842bcadf
CB
2843$ ivdformat="""Ld"""
2844$ uvuformat="""Lu"""
2845$ uvoformat="""Lo"""
2846$ uvxformat="""Lx"""
2847$ uvXUformat="""LX"""
570bb66e
JH
2848$ ELSE
2849$ use64bitint = "undef"
2850$ uselargefiles = "undef"
2851$ uselongdouble = "undef"
2852$ usemorebits = "undef"
842bcadf
CB
2853$ ivdformat="""ld"""
2854$ uvuformat="""lu"""
2855$ uvoformat="""lo"""
2856$ uvxformat="""lx"""
2857$ uvXUformat="""lX"""
2858$ ENDIF
2859$ IF uselongdouble .OR. uselongdouble .EQS. "define"
2860$ THEN
2861$ nveformat="""Le"""
2862$ nvfformat="""Lf"""
2863$ nvgformat="""Lg"""
2864$ ELSE
2865$ nveformat="""e"""
2866$ nvfformat="""f"""
2867$ nvgformat="""g"""
570bb66e
JH
2868$ ENDIF
2869$ IF use64bitall .OR. use64bitall .EQS. "define"
2870$ THEN
2871$ use64bitall = "define"
2872$ ELSE
2873$ use64bitall = "undef"
2874$ ENDIF
2875$!
9b5c8979
JH
2876$ usemymalloc = "undef"
2877$ if mymalloc then usemymalloc = "define"
570bb66e
JH
2878$!
2879$ perl_cc=Mcc
2880$!
55315086 2881$ IF (sharedperl .AND. archname .EQS. "VMS_AXP")
570bb66e
JH
2882$ THEN
2883$ obj_ext=".abj"
2884$ so="axe"
2885$ dlext="axe"
2886$ exe_ext=".axe"
2887$ lib_ext=".alb"
2888$ ELSE
2889$ obj_ext=".obj"
2890$ so="exe"
2891$ dlext="exe"
2892$ exe_ext=".exe"
2893$ lib_ext=".olb"
2894$ ENDIF
2895$ dlobj="dl_vms''obj_ext'"
2896$!
2897$ cppstdin="''perl_cc'/noobj/preprocess=sys$output sys$input"
2898$ cppminus=" "
2899$ cpprun="''perl_cc'/noobj/preprocess=sys$output sys$input"
2900$ cpplast=" "
2901$!
2902$ timetype="time_t"
2903$ signal_t="void"
2904$ stdchar="char"
2905$!
2906$ IF mymalloc
2907$ THEN d_mymalloc="define"
2908$ ELSE d_mymalloc="undef"
2909$ ENDIF
2910$!
2911$ usedl="define"
ef060a86 2912$ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
4a5365b8 2913$ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
570bb66e
JH
2914$!
2915$ IF ((Use_Threads) .AND. (vms_ver .LES. "6.2"))
2916$ THEN
2917$ 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"
2918$ ELSE
2919$ libs=" "
2920$ ENDIF
414b89cc 2921$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
570bb66e
JH
2922$ THEN
2923$ libc="(DECCRTL)"
2924$ ELSE
2925$ libc=" "
2926$ ENDIF
2927$!
94928b12
JH
2928$! perllibs should be libs with all non-core libs (such as gdbm) removed.
2929$!
2930$ perllibs=libs
2931$!
570bb66e
JH
2932$! Are we 64 bit?
2933$!
2934$ IF use64bitint .OR. use64bitint .EQS. "define"
2935$ THEN
2936$ d_PRId64 = "define"
6b356c8e
JH
2937$ d_PRIEUldbl = "define"
2938$ d_PRIFUldbl = "define"
2939$ d_PRIGUldbl = "define"
59a27e12 2940$ d_PRIeldbl = "define"
570bb66e
JH
2941$ d_PRIfldbl = "define"
2942$ d_PRIgldbl = "define"
2943$ d_PRIu64 = "define"
2944$ d_PRIo64 = "define"
2945$ d_PRIx64 = "define"
842bcadf 2946$ d_PRIXU64 = "define"
570bb66e 2947$ sPRId64 = """Ld"""
6b356c8e
JH
2948$ sPRIEUldbl = """LE"""
2949$ sPRIFUldbl = """LF"""
2950$ sPRIGUldbl = """LG"""
2951$ sPRIXU64 = """LX"""
59a27e12 2952$ sPRIeldbl = """Le"""
570bb66e
JH
2953$ sPRIfldbl = """Lf"""
2954$ sPRIgldbl = """Lg"""
59a27e12 2955$ sPRIi64 = """Li"""
570bb66e
JH
2956$ sPRIo64 = """Lo"""
2957$ sPRIu64 = """Lu"""
2958$ sPRIx64 = """Lx"""
2959$ d_quad = "define"
2960$ quadtype = "long long"
2961$ uquadtype = "unsigned long long"
2962$ quadkind = "QUAD_IS_LONG_LONG"
2963$ d_frexpl = "define"
dfe814dc 2964$ d_isnan = "define"
570bb66e
JH
2965$ d_isnanl = "define"
2966$ d_modfl = "define"
2967$ ELSE
2968$ d_PRId64 = "undef"
6b356c8e
JH
2969$ d_PRIEUldbl = "define"
2970$ d_PRIFUldbl = "define"
2971$ d_PRIGUldbl = "define"
2972$ d_PRIXU64 = "undef"
59a27e12 2973$ d_PRIeldbl = "define"
570bb66e
JH
2974$ d_PRIfldbl = "undef"
2975$ d_PRIgldbl = "undef"
2976$ d_PRIu64 = "undef"
2977$ d_PRIo64 = "undef"
2978$ d_PRIx64 = "undef"
2979$ sPRId64 = ""
6b356c8e
JH
2980$ sPRIEUldbl = """E"""
2981$ sPRIFUldbl = """F"""
2982$ sPRIGUldbl = """G"""
2983$ sPRIXU64 = """lX"""
59a27e12
PP
2984$ sPRIeldbl = """e"""
2985$ sPRIfldbl = """f"""
2986$ sPRIgldbl = """g"""
2987$ sPRIi64 = ""
570bb66e
JH
2988$ sPRIo64 = ""
2989$ sPRIu64 = ""
2990$ sPRIx64 = ""
2991$ d_quad = "undef"
2992$ quadtype = "long"
2993$ uquadtype = "unsigned long"
2994$ quadkind = "QUAD_IS_LONG"
2995$ d_frexpl = "undef"
dfe814dc 2996$ d_isnan = "undef"
570bb66e
JH
2997$ d_isnanl = "undef"
2998$ d_modfl = "undef"
2999$ ENDIF
b5ddfb46
PP
3000$ d_SCNfldbl = d_PRIfldbl
3001$ sSCNfldbl = sPRIfldbl ! expect consistency
570bb66e
JH
3002$!
3003$! Now some that we build up
3004$!
3005$ IF Use_Threads
3006$ THEN
3007$ IF use_5005_threads
3008$ THEN
3009$ arch = "''arch'-thread"
3010$ archname = "''archname'-thread"
3011$ d_old_pthread_create_joinable = "undef"
3012$ old_pthread_create_joinable = " "
3013$ use5005threads = "define"
3014$ useithreads = "undef"
3015$ ELSE
3016$ arch = "''arch'-ithread"
3017$ archname = "''archname'-ithread"
3018$ d_old_pthread_create_joinable = "undef"
3019$ old_pthread_create_joinable = " "
3020$ use5005threads = "undef"
3021$ useithreads = "define"
3022$ ENDIF
3023$ ELSE
3024$ d_old_pthread_create_joinable = "undef"
3025$ old_pthread_create_joinable = " "
3026$ use5005threads = "undef"
3027$ useithreads = "undef"
3028$ ENDIF
3029$!
3030$! Some that we need to invoke the compiler for
3031$!
3032$!
3033$! handy construction aliases/symbols
3034$!
3035$ OS := "open/write CONFIG []try.c"
3036$ WS := "write CONFIG"
3037$ CS := "close CONFIG"
3038$ DS := "delete/nolog/noconfirm []try.*;*"
3039$ Needs_Opt := N
3040$ good_compile = %X10B90001
414b89cc 3041$ IF ccname .EQS. "GCC"
570bb66e
JH
3042$ THEN
3043$ open/write OPTCHAN []try.opt
3044$ write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3045$ write OPTCHAN "Sys$Share:VAXCRTL/Share"
3046$ Close OPTCHAN
3047$ Needs_Opt := Y
3048$ good_compile = %X10000001
3049$ ENDIF
414b89cc 3050$ IF ccname .EQS. "CXX"
570bb66e
JH
3051$ THEN
3052$ good_compile = %X15F60001
3053$ ENDIF
3054$ good_link = %X10000001
3055$ tmp = "" ! null string default
3056$!
3057$ GOTO beyond_compile_ok
3058$!
3059$! Check for type sizes
3060$!
3061$type_size_check:
3062$!
3063$ OS
7558ebc2
PP
3064$ WS "#if defined(__DECC) || defined(__DECCXX)"
3065$ WS "#include <stdlib.h>"
3066$ WS "#endif"
3067$ WS "#include <stdio.h>"
3068$ WS "int main()"
570bb66e
JH
3069$ WS "{"
3070$ WS "printf(""%d\n"", sizeof(''tmp'));"
7558ebc2 3071$ WS "exit(0);"
570bb66e
JH
3072$ WS "}"
3073$ CS
3074$ GOSUB compile
3075$ RETURN
3076$!
3077$!: locate header file
3078$findhdr:
3079$!
3080$ OS
7558ebc2
PP
3081$ WS "#if defined(__DECC) || defined(__DECCXX)"
3082$ WS "#include <stdlib.h>"
3083$ WS "#endif"
3084$ WS "#include <stdio.h>"
570bb66e 3085$ WS "#include <''tmp'>"
7558ebc2 3086$ WS "int main()"
570bb66e
JH
3087$ WS "{"
3088$ WS "printf(""define\n"");"
7558ebc2 3089$ WS "exit(0);"
570bb66e
JH
3090$ WS "}"
3091$ CS
3092$ GOSUB link_ok
3093$ RETURN
3094$!
3095$!: define an alternate in-header-list? function
3096$inhdr:
3097$!
3098$ GOSUB findhdr
3099$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3100$ THEN
3101$ echo4 "<''tmp'> found."
3102$ tmp = "define"
3103$ ELSE
3104$ echo4 "<''tmp'> NOT found."
3105$ tmp = "undef"
3106$ ENDIF
3107$ RETURN
3108$!
3109$!: define an is-in-libc? function
3110$inlibc:
3111$ GOSUB link_ok
3112$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3113$ THEN
3114$ echo4 "''tmp'() found."
3115$ tmp = "define"
3116$ ELSE
3117$ echo4 "''tmp'() NOT found."
3118$ tmp = "undef"
3119$ ENDIF
3120$ RETURN
3121$!
3122$!: define a shorthand compile call
3123$compile:
3124$ GOSUB link_ok
3125$just_mcr_it:
3126$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3127$ THEN
3128$ OPEN/WRITE CONFIG []try.out
3129$ DEFINE/USER_MODE SYS$ERROR CONFIG
3130$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
3131$ MCR []try.exe
3132$ CLOSE CONFIG
3133$ OPEN/READ CONFIG []try.out
3134$ READ CONFIG tmp
3135$ CLOSE CONFIG
3136$ DELETE/NOLOG/NOCONFIRM []try.out;
3137$ DELETE/NOLOG/NOCONFIRM []try.exe;
3138$ ELSE
3139$ tmp = "" ! null string default
3140$ ENDIF
3141$ RETURN
3142$!
3143$link_ok:
3144$ GOSUB compile_ok
3145$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3146$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3147$ SET NOON
3148$ IF Needs_Opt
3149$ THEN
3150$ 'ld' try.obj,try.opt/opt
3151$ link_status = $status
3152$ ELSE
3153$ 'ld' try.obj
3154$ link_status = $status
3155$ ENDIF
3156$ SET ON
3157$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3158$ RETURN
3159$!
3160$!: define a shorthand compile call for compilations that should be ok.
3161$compile_ok:
3162$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3163$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3164$ SET NOON
3165$ 'Checkcc' try.c
3166$ compile_status = $status
3167$ SET ON
3168$ DELETE/NOLOG/NOCONFIRM try.c;
3169$ RETURN
3170$!
3171$beyond_compile_ok:
3172$!
3173$! Check for __STDC__
3174$!
3175$ OS
7558ebc2
PP
3176$ WS "#if defined(__DECC) || defined(__DECCXX)"
3177$ WS "#include <stdlib.h>"
3178$ WS "#endif"
3179$ WS "#include <stdio.h>"
3180$ WS "int main()"
570bb66e 3181$ WS "{"
7558ebc2
PP
3182$ WS "#ifdef __STDC__"
3183$ WS "printf(""42\n"");"
3184$ WS "#else"
3185$ WS "printf(""1\n"");"
3186$ WS "#endif"
3187$ WS "exit(0);"
570bb66e
JH
3188$ WS "}"
3189$ CS
3190$ GOSUB compile
3191$ cpp_stuff=tmp
3192$ IF F$INTEGER(tmp) .eq. 42
3193$ THEN
3194$ echo4 "Your C compiler and pre-processor defines the symbol:"
3195$ echo4 "__STDC__"
3196$ ENDIF
3197$!
3198$! Check for double size
3199$!
3200$ echo4 "Checking to see how big your double precision numbers are..."
3201$ tmp="double"
3202$ GOSUB type_size_check
3203$ doublesize = tmp
3204$ echo "Your double is ''doublesize' bytes long."
3205$!
3206$! Check for long double size
3207$!
3208$ OS
7558ebc2
PP
3209$ WS "#if defined(__DECC) || defined(__DECCXX)"
3210$ WS "#include <stdlib.h>"
3211$ WS "#endif"
3212$ WS "#include <stdio.h>"
3213$ WS "int main()"
570bb66e 3214$ WS "{"
7558ebc2
PP
3215$ WS "printf(""%d\n"", sizeof(long double));"
3216$ WS "exit(0);"
570bb66e
JH
3217$ WS "}"
3218$ CS
3219$ echo4 "Checking to see if you have long double..."
3220$ GOSUB link_ok
3221$ IF link_status .NE. good_link
3222$ THEN
3223$ longdblsize="0"
3224$ d_longdbl="undef"
3225$ echo "You do not have long double."
3226$ ELSE
3227$ echo "You have long double."
3228$ echo4 "Checking to see how big your long doubles are..."
3229$ GOSUB just_mcr_it
3230$ longdblsize = tmp
3231$ d_longdbl = "define"
3232$ echo "Your long doubles are ''longdblsize' bytes long."
3233$ ENDIF
3234$!
3235$!: check for long long
3236$ OS
7558ebc2
PP
3237$ WS "#if defined(__DECC) || defined(__DECCXX)"
3238$ WS "#include <stdlib.h>"
3239$ WS "#endif"
3240$ WS "#include <stdio.h>"
3241$ WS "int main()"
570bb66e 3242$ WS "{"
7558ebc2
PP
3243$ WS "printf(""%d\n"", sizeof(long long));"
3244$ WS "exit(0);"
570bb66e
JH
3245$ WS "}"
3246$ CS
3247$ echo4 "Checking to see if you have long long..."
3248$ GOSUB link_ok
3249$ IF link_status .NE. good_link
3250$ THEN
3251$ longlongsize="0"
3252$ d_longlong="undef"
3253$ echo "You do not have long long."
3254$ ELSE
3255$ echo "You have long long."
3256$ echo4 "Checking to see how big your long longs are..."
3257$ GOSUB just_mcr_it
3258$ longlongsize = tmp
3259$ d_longlong = "define"
3260$ echo "Your long longs are ''longlongsize' bytes long."
3261$ ENDIF
3262$!
3263$! Check the prototype for getgid
3264$!
3265$ echo "Looking for the type for group ids returned by getgid()."
3266$ OS
7558ebc2
PP
3267$ WS "#if defined(__DECC) || defined(__DECCXX)"
3268$ WS "#include <stdlib.h>"
3269$ WS "#endif"
3270$ WS "#include <stdio.h>"
3271$ WS "#include <types.h>"
3272$ WS "int main()"
570bb66e 3273$ WS "{"
7558ebc2
PP
3274$ WS "gid_t foo;"
3275$ WS "exit(0);"
570bb66e
JH
3276$ WS "}"
3277$ CS
3278$ GOSUB compile_ok
3279$ IF compile_status .NE. good_compile
3280$ THEN
3281$! Okay, gid_t failed. Must be unsigned int
3282$ gidtype = "unsigned int"
3283$ echo4 "assuming ""''gidtype'""."
3284$ ELSE
3285$ gidtype = "gid_t"
3286$ echo4 "gid_t found."
3287$ ENDIF
3288$!
3289$! Check to see if we've got dev_t
3290$!
3291$ echo "Looking for the type for dev."
3292$ OS
7558ebc2
PP
3293$ WS "#if defined(__DECC) || defined(__DECCXX)"
3294$ WS "#include <stdlib.h>"
3295$ WS "#endif"
3296$ WS "#include <stdio.h>"
3297$ WS "#include <types.h>"
3298$ WS "int main()"
570bb66e 3299$ WS "{"
7558ebc2
PP
3300$ WS "dev_t foo;"
3301$ WS "exit(0);"
570bb66e
JH
3302$ WS "}"
3303$ CS
3304$ GOSUB compile_ok
3305$ IF compile_status .NE. good_compile
3306$ THEN
3307$! Okay, dev_t failed. Must be unsigned int
3308$ devtype = "unsigned int"
3309$ echo4 "assuming ""''devtype'""."
3310$ ELSE
3311$ devtype = "dev_t"
3312$ echo4 "dev_t found."
3313$ ENDIF
3314$!
3315$! Check to see if we've got unistd.h (which we ought to, but you never know)
3316$!
3317$ i_netdb = "undef"
3318$ tmp = "unistd.h"
3319$ GOSUB inhdr
3320$ i_unistd = tmp
3321$!
3322$!: see if this is a libutil.h system
3323$!
3324$ tmp = "libutil.h"
3325$ GOSUB inhdr
3326$ i_libutil = tmp
3327$!
3328$! Check to see if we've got shadow.h (probably not, but...)
3329$!
3330$ tmp = "shadow.h"
3331$ GOSUB inhdr
3332$ i_shadow = tmp
3333$!
3334$! Check to see if we've got socks.h (probably not, but...)
3335$!
3336$ tmp = "socks.h"
3337$ GOSUB inhdr
3338$ i_socks = tmp
3339$!
3340$! Check the prototype for select
3341$!
3342$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3343$ THEN
3344$ OS
7558ebc2
PP
3345$ WS "#if defined(__DECC) || defined(__DECCXX)"
3346$ WS "#include <stdlib.h>"
3347$ WS "#endif"
3348$ WS "#include <stdio.h>"
3349$ WS "#include <types.h>"
3350$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
570bb66e
JH
3351$ IF Has_Socketshr
3352$ THEN
3353$ WS "#include <socketshr.h>"
3354$ ELSE
7558ebc2
PP
3355$ WS "#include <time.h>"
3356$ WS "#include <socket.h>"
570bb66e 3357$ ENDIF
7558ebc2 3358$ WS "int main()"
570bb66e 3359$ WS "{"
7558ebc2
PP
3360$ WS "fd_set *foo;"
3361$ WS "int bar;"
3362$ WS "foo = NULL;"
3363$ WS "bar = select(2, foo, foo, foo, NULL);"
3364$ WS "exit(0);"
570bb66e
JH
3365$ WS "}"
3366$ CS
3367$ GOSUB compile_ok
3368$ IF compile_status .NE. good_compile
3369$ THEN
3370$! Okay, select failed. Must be an int *
3371$ selecttype = "int *"
3372$ echo4 "select() NOT found."
3373$ ELSE
3374$ selecttype="fd_set *"
3375$ echo4 "select() found."
3376$ ENDIF
3377$ ELSE
3378$ ! No sockets, so stick in an int * : no select, so pick a harmless default
3379$ selecttype = "int *"
3380$ ENDIF
3381$!
3382$! Check to see if fd_set exists
3383$!
3384$ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3385$ OS
7558ebc2
PP
3386$ WS "#if defined(__DECC) || defined(__DECCXX)"
3387$ WS "#include <stdlib.h>"
3388$ WS "#endif"
3389$ WS "#include <stdio.h>"
3390$ WS "#include <types.h>"
570bb66e
JH
3391$ IF Has_Socketshr
3392$ THEN
3393$ WS "#include <socketshr.h>"
3394$ ENDIF
3395$ IF Has_Dec_C_Sockets
3396$ THEN
7558ebc2
PP
3397$ WS "#include <time.h>"
3398$ WS "#include <socket.h>"
570bb66e 3399$ ENDIF
7558ebc2 3400$ WS "int main()"
570bb66e 3401$ WS "{"
7558ebc2
PP
3402$ WS "fd_set *foo;"
3403$ WS "int bar;"
3404$ WS "exit(0);"
570bb66e
JH
3405$ WS "}"
3406$ CS
3407$ GOSUB compile_ok
3408$ IF compile_status .ne. good_compile
3409$ THEN
3410$! Okay, fd_set failed. Must not exist
3411$ d_fd_set = "undef"
3412$ echo4 "Hmm, your compiler has some difficulty with fd_set."
3413$ ELSE
3414$ d_fd_set="define"
3415$ echo4 "Well, your system knows about the normal fd_set typedef..."
3416$ ENDIF
3417$!
3418$! Check for inttypes.h
3419$!
3420$ tmp = "inttypes.h"
3421$ GOSUB inhdr
3422$ i_inttypes = tmp
3423$!
3424$! Check to see if off64_t exists
3425$!
3426$ echo4 "Checking to see if you have off64_t..."
3427$ OS
7558ebc2
PP
3428$ WS "#if defined(__DECC) || defined(__DECCXX)"
3429$ WS "#include <stdlib.h>"
3430$ WS "#endif"
3431$ WS "#include <stdio.h>"
3432$ WS "#include <types.h>"
3433$ WS "#''i_inttypes' IIH"
3434$ WS "#ifdef IIH"
3435$ WS "#include <inttypes.h>"
3436$ WS "#endif"
3437$ WS "int main()"
570bb66e 3438$ WS "{"
7558ebc2
PP
3439$ WS "off64_t bar;"
3440$ WS "exit(0);"
570bb66e
JH
3441$ WS "}"
3442$ CS
3443$ GOSUB compile_ok
3444$ IF compile_status .EQ. good_compile
3445$ THEN
3446$ d_off64_t="define"
3447$ echo "You have off64_t."
3448$ ELSE
3449$ d_off64_t = "undef"
3450$ echo "You do not have off64_t."
3451$ ENDIF
3452$!
3453$! Check to see if fpos64_t exists
3454$!
3455$ echo4 "Checking to see if you have fpos64_t..."
3456$ OS
7558ebc2
PP
3457$ WS "#if defined(__DECC) || defined(__DECCXX)"
3458$ WS "#include <stdlib.h>"
3459$ WS "#endif"
3460$ WS "#include <stdio.h>"
3461$ WS "#include <types.h>"
3462$ WS "#''i_inttypes' IIH"
3463$ WS "#ifdef IIH"
3464$ WS "#include <inttypes.h>"
3465$ WS "#endif"
3466$ WS "int main()"
570bb66e 3467$ WS "{"
7558ebc2
PP
3468$ WS "fpos64_t bar;"
3469$ WS "exit(0);"
570bb66e
JH
3470$ WS "}"
3471$ CS
3472$ GOSUB compile_ok
3473$ IF compile_status .EQ. good_compile
3474$ THEN
3475$ d_fpos64_t="define"
3476$ echo "You have fpos64_t."
3477$ ELSE
3478$ d_fpos64_t = "undef"
3479$ echo "You do not have fpos64_t."
3480$ ENDIF
3481$!
3482$! Check to see if int64_t exists
3483$!
3484$ echo4 "Checking to see if you have int64_t..."
3485$ OS
7558ebc2
PP
3486$ WS "#if defined(__DECC) || defined(__DECCXX)"
3487$ WS "#include <stdlib.h>"
3488$ WS "#endif"
3489$ WS "#include <stdio.h>"
3490$ WS "#include <types.h>"
3491$ WS "#''i_inttypes' IIH"
3492$ WS "#ifdef IIH"
3493$ WS "#include <inttypes.h>"
3494$ WS "#endif"
3495$ WS "int main()"
570bb66e 3496$ WS "{"
7558ebc2
PP
3497$ WS "int64_t bar;"
3498$ WS "exit(0);"
570bb66e
JH
3499$ WS "}"
3500$ CS
3501$ GOSUB compile_ok
3502$ IF compile_status .EQ. good_compile
3503$ THEN
3504$ d_int64_t="define"
3505$ echo "You have int64_t."
3506$ ELSE
3507$ d_int64_t = "undef"
3508$ echo "You do not have int64_t."
3509$ ENDIF
3510$!
3511$!: see if this is a netdb.h system
3512$ IF Has_Dec_C_Sockets
3513$ THEN
3514$ tmp = "netdb.h"
3515$ GOSUB inhdr
3516$ i_netdb = tmp
3517$ ENDIF
3518$!
3519$! Check for h_errno
3520$!
3521$ echo4 "Checking to see if you have h_errno..."
3522$ OS
7558ebc2
PP
3523$ WS "#if defined(__DECC) || defined(__DECCXX)"
3524$ WS "#include <stdlib.h>"
3525$ WS "#endif"
3526$ WS "#include <stdio.h>"
3527$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3528$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
3529$ WS "int main()"
570bb66e 3530$ WS "{"
7558ebc2
PP
3531$ WS "h_errno = 3;"
3532$ WS "exit(0);"
570bb66e
JH
3533$ WS "}"
3534$ CS
3535$ GOSUB link_ok
3536$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3537$ THEN
3538$ d_herrno="define"
3539$ echo "You have h_errno."
3540$ ELSE
3541$ d_herrno="undef"
3542$ echo "You do not have h_errno."
3543$ ENDIF
3544$!
3545$! Check to see if gethostname exists
3546$!
3547$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3548$ THEN
3549$ OS
7558ebc2
PP
3550$ WS "#if defined(__DECC) || defined(__DECCXX)"
3551$ WS "#include <stdlib.h>"
3552$ WS "#endif"
3553$ WS "#include <stdio.h>"
3554$ WS "#include <types.h>"
570bb66e
JH
3555$ IF Has_Socketshr
3556$ THEN
3557$ WS "#include <socketshr.h>"
3558$ ELSE
7558ebc2
PP
3559$ WS "#include <time.h>"
3560$ WS "#include <socket.h>"
570bb66e 3561$ ENDIF
7558ebc2 3562$ WS "int main()"
570bb66e 3563$ WS "{"
7558ebc2
PP
3564$ WS "char name[100];"
3565$ WS "int bar, baz;"
3566$ WS "bar = 100;"
3567$ WS "baz = gethostname(name, bar);"
3568$ WS "exit(0);"
570bb66e
JH
3569$ WS "}"
3570$ CS
3571$ GOSUB link_ok
3572$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3573$ THEN
3574$ d_gethname="define"
3575$ echo4 "gethostname() found."
3576$ ELSE
3577$ d_gethname="undef"
3578$ ENDIF
3579$ ELSE
3580$ ! No sockets, so no gethname
3581$ d_gethname = "undef"
3582$ ENDIF
3583$!
3584$! Check for sys/file.h
3585$!
3586$ tmp = "sys/file.h"
3587$ GOSUB inhdr
3588$ i_sysfile = tmp
3589$!
3590$! Check for sys/utsname.h
3591$!
3592$ tmp = "sys/utsname.h"
3593$ GOSUB inhdr
3594$ i_sysutsname = tmp
3595$!
3596$! Check for syslog.h
3597$!
3598$ tmp = "syslog.h"
3599$ GOSUB inhdr
3600$ i_syslog = tmp
3601$!
3602$! Check for poll.h
3603$!
3604$ tmp = "poll.h"
3605$ GOSUB inhdr
3606$ i_poll = tmp
3607$!
3608$! Check for sys/uio.h
3609$!
3610$ tmp = "sys/uio.h"
3611$ GOSUB inhdr
3612$ i_sysuio = tmp
3613$!
3614$! Check for sys/mode.h
3615$!
3616$ tmp = "sys/mode.h"
3617$ GOSUB inhdr
3618$ i_sysmode = tmp
3619$!
3620$! Check for sys/access.h
3621$!
3622$ tmp = "sys/access.h"
3623$ GOSUB inhdr
3624$ i_sysaccess = tmp
3625$!
3626$! Check for sys/security.h
3627$!
3628$ tmp = "sys/security.h"
3629$ GOSUB inhdr
3630$ i_syssecrt = tmp
3631$!
3632$! Check for fcntl.h
3633$!
3634$ tmp = "fcntl.h"
3635$ GOSUB inhdr
3636$ i_fcntl = tmp
3637$!
3638$! Check for fcntl
3639$!
3640$ OS
7558ebc2
PP
3641$ WS "#if defined(__DECC) || defined(__DECCXX)"
3642$ WS "#include <stdlib.h>"
3643$ WS "#endif"
3644$ WS "#include <stdio.h>"
3645$ WS "#include <fcntl.h>"
3646$ WS "int main()"
570bb66e 3647$ WS "{"
7558ebc2
PP
3648$ WS "fcntl(1,2,3);"
3649$ WS "exit(0);"
570bb66e
JH
3650$ WS "}"
3651$ CS
3652$ tmp = "fcntl"
3653$ GOSUB inlibc
3654$ d_fcntl = tmp
3655$!
c44c4826
CB
3656$! Check for fcntl locking capability
3657$!
3658$ echo4 "Checking if fcntl-based file locking works... "
3659$ tmp = "undef"
3660$ IF d_fcntl .EQS. "define"
3661$ THEN
3662$ OS
3663$ WS "#include <stdio.h>"
3664$ WS "#if defined(__DECC) || defined(__DECCXX)"
3665$ WS "#include <stdlib.h>"
3666$ WS "#endif"
3667$ WS "#include <fcntl.h>"
3668$ WS "#include <unistd.h>"
3669$ WS "int main() {"
3670$ WS "#if defined(F_SETLK) && defined(F_SETLKW)"
3671$ WS " struct flock flock;"
3672$ WS " int retval, fd;"
3673$ WS " fd = open(""try.c"", O_RDONLY);"
3674$ WS " flock.l_type = F_RDLCK;"
3675$ WS " flock.l_whence = SEEK_SET;"
3676$ WS " flock.l_start = flock.l_len = 0;"
3677$ WS " retval = fcntl(fd, F_SETLK, &flock);"
3678$ WS " close(fd);"
3679$ WS " (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
3680$ WS "#else"
3681$ WS " printf(""undef\n"");"
3682$ WS "#endif"
3683$ WS "}"
3684$ CS
3685$ GOSUB link_ok
3686$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3687$ THEN
3688$ GOSUB just_mcr_it
3689$ IF tmp .EQS. "define"
3690$ THEN
3691$ echo4 "Yes, it seems to work."
3692$ ELSE
3693$ echo4 "Nope, it didn't work."
3694$ ENDIF
3695$ ELSE
3696$ echo4 "I'm unable to compile the test program, so I'll assume not."
3697$ tmp = "undef"
3698$ ENDIF
3699$ ELSE
3700$ echo4 "Nope, since you don't even have fcntl()."
3701$ ENDIF
3702$ d_fcntl_can_lock = tmp
3703$!
570bb66e
JH
3704$! Check for memchr
3705$!
3706$ OS
7558ebc2
PP
3707$ WS "#if defined(__DECC) || defined(__DECCXX)"
3708$ WS "#include <stdlib.h>"
3709$ WS "#endif"
3710$ WS "#include <string.h>"
3711$ WS "int main()"
570bb66e 3712$ WS "{"
7558ebc2 3713$ WS "char * place;"
a5ff3b9a 3714$ WS "place = memchr(""foo"", 47, 3);"
7558ebc2 3715$ WS "exit(0);"
570bb66e
JH
3716$ WS "}"
3717$ CS
3718$ tmp = "memchr"
3719$ GOSUB inlibc
3720$ d_memchr = tmp
3721$!
3722$! Check for strtoull
3723$!
3724$ OS
7558ebc2
PP
3725$ WS "#if defined(__DECC) || defined(__DECCXX)"
3726$ WS "#include <stdlib.h>"
3727$ WS "#endif"
3728$ WS "#include <string.h>"
3729$ WS "int main()"
570bb66e 3730$ WS "{"
7558ebc2
PP
3731$ WS "unsigned __int64 result;"
3732$ WS "result = strtoull(""123123"", NULL, 10);"
3733$ WS "exit(0);"
570bb66e
JH
3734$ WS "}"
3735$ CS
3736$ tmp = "strtoull"
3737$ GOSUB inlibc
3738$ d_strtoull = tmp
3739$!
3740$! Check for strtouq
3741$!
3742$ OS
7558ebc2
PP
3743$ WS "#if defined(__DECC) || defined(__DECCXX)"
3744$ WS "#include <stdlib.h>"
3745$ WS "#endif"
3746$ WS "#include <string.h>"
3747$ WS "int main()"
570bb66e 3748$ WS "{"
7558ebc2
PP
3749$ WS "unsigned __int64 result;"
3750$ WS "result = strtouq(""123123"", NULL, 10);"
3751$ WS "exit(0);"
570bb66e
JH
3752$ WS "}"
3753$ CS
3754$ tmp = "strtouq"
3755$ GOSUB inlibc
3756$ d_strtouq = tmp
3757$!
3758$! Check for strtoll
3759$!
3760$ OS
7558ebc2
PP
3761$ WS "#if defined(__DECC) || defined(__DECCXX)"
3762$ WS "#include <stdlib.h>"
3763$ WS "#endif"
3764$ WS "#include <string.h>"
3765$ WS "int main()"
570bb66e 3766$ WS "{"
7558ebc2
PP
3767$ WS "__int64 result;"
3768$ WS "result = strtoll(""123123"", NULL, 10);"
3769$ WS "exit(0);"
570bb66e
JH
3770$ WS "}"
3771$ CS
3772$ tmp = "strtoll"
3773$ GOSUB inlibc
3774$ d_strtoll = tmp
3775$!
d0e6d399
NC
3776$! Check for strtoq
3777$!
3778$ OS
3779$ WS "#if defined(__DECC) || defined(__DECCXX)"
3780$ WS "#include <stdlib.h>"
28e5dec8
JH
3781$ WS "#endif"
3782$ WS "#include <string.h>"
3783$ WS "int main()"
3784$ WS "{"
3785$ WS "__int64 result;"
3786$ WS "result = strtoq(""123123"", NULL, 10);"
3787$ WS "exit(0);"
3788$ WS "}"
3789$ CS
3790$ tmp = "strtoq"
3791$ GOSUB inlibc
3792$ d_strtoq = tmp
3793$!
3794$! Check for strtoq
3795$!
3796$ OS
3797$ WS "#if defined(__DECC) || defined(__DECCXX)"
3798$ WS "#include <stdlib.h>"
d0e6d399
NC
3799$ WS "#endif"
3800$ WS "#include <string.h>"
3801$ WS "int main()"
3802$ WS "{"
3803$ WS "__int64 result;"
3804$ WS "result = strtoq(""123123"", NULL, 10);"
3805$ WS "exit(0);"
3806$ WS "}"
3807$ CS
3808$ tmp = "strtoq"
3809$ GOSUB inlibc
3810$ d_strtoq = tmp
3811$!
570bb66e
JH
3812$! Check for strtold
3813$!
3814$ OS
7558ebc2
PP
3815$ WS "#if defined(__DECC) || defined(__DECCXX)"
3816$ WS "#include <stdlib.h>"
3817$ WS "#endif"
3818$ WS "#include <string.h>"
3819$ WS "int main()"
570bb66e 3820$ WS "{"
7558ebc2
PP
3821$ WS "long double result;"
3822$ WS "result = strtold(""123123"", NULL, 10);"
3823$ WS "exit(0);"
570bb66e
JH
3824$ WS "}"
3825$ CS
3826$ tmp = "strtold"
3827$ GOSUB inlibc
3828$ d_strtold = tmp
3829$!
3830$! Check for atoll
3831$!
3832$ OS
7558ebc2
PP
3833$ WS "#if defined(__DECC) || defined(__DECCXX)"
3834$ WS "#include <stdlib.h>"
3835$ WS "#endif"
3836$ WS "#include <string.h>"
3837$ WS "int main()"
570bb66e 3838$ WS "{"
7558ebc2
PP
3839$ WS " __int64 result;"
3840$ WS "result = atoll(""123123"");"
3841$ WS "exit(0);"
570bb66e
JH
3842$ WS "}"
3843$ CS
3844$ tmp = "atoll"
3845$ GOSUB inlibc
3846$ d_atoll = tmp
3847$!
3848$! Check for atolf
3849$!
3850$ OS
7558ebc2
PP
3851$ WS "#if defined(__DECC) || defined(__DECCXX)"
3852$ WS "#include <stdlib.h>"
3853$ WS "#endif"
3854$ WS "#include <string.h>"
3855$ WS "int main()"
570bb66e 3856$ WS "{"
7558ebc2
PP
3857$ WS "long double"
3858$ WS "result = atolf(""123123"");"
3859$ WS "exit(0);"
570bb66e
JH
3860$ WS "}"
3861$ CS
3862$ tmp = "atolf"
3863$ GOSUB inlibc
3864$ d_atolf = tmp
3865$!
3866$! Check for access
3867$!
3868$ OS
7558ebc2
PP
3869$ WS "#if defined(__DECC) || defined(__DECCXX)"
3870$ WS "#include <stdlib.h>"
3871$ WS "#endif"
3872$ WS "#include <stdio.h>"
3873$ WS "int main()"
570bb66e 3874$ WS "{"
7558ebc2
PP
3875$ WS "access(""foo"", F_OK);"
3876$ WS "exit(0);"
570bb66e
JH
3877$ WS "}"
3878$ CS
3879$ tmp = "acess"
3880$ GOSUB inlibc
3881$ d_access = tmp
3882$!
3883$! Check for bzero
3884$!
3885$ OS
7558ebc2
PP
3886$ WS "#if defined(__DECC) || defined(__DECCXX)"
3887$ WS "#include <stdlib.h>"
3888$ WS "#endif"
3889$ WS "#include <stdio.h>"
3890$ WS "#include <strings.h>"
3891$ WS "int main()"
570bb66e 3892$ WS "{"
7558ebc2
PP
3893$ WS "char foo[10];"
3894$ WS "bzero(foo, 10);"
3895$ WS "exit(0);"
570bb66e
JH
3896$ WS "}"
3897$ CS
3898$ tmp = "bzero"
3899$ GOSUB inlibc
3900$ d_bzero = tmp
3901$!
3902$! Check for bcopy
3903$!
3904$ OS
7558ebc2
PP
3905$ WS "#if defined(__DECC) || defined(__DECCXX)"
3906$ WS "#include <stdlib.h>"
3907$ WS "#endif"
3908$ WS "#include <stdio.h>"
3909$ WS "#include <strings.h>"
3910$ WS "int main()"
570bb66e 3911$ WS "{"
7558ebc2
PP
3912$ WS "char foo[10], bar[10];"
3913$ WS "bcopy(""foo"", bar, 3);"
3914$ WS "exit(0);"
570bb66e
JH
3915$ WS "}"
3916$ CS
3917$ tmp = "bcopy"
3918$ GOSUB inlibc
3919$ d_bcopy = tmp
3920$!
3921$! Check for mkstemp
3922$!
3923$ OS
7558ebc2
PP
3924$ WS "#if defined(__DECC) || defined(__DECCXX)"
3925$ WS "#include <stdlib.h>"
3926$ WS "#endif"
3927$ WS "#include <stdio.h>"
3928$ WS "int main()"
570bb66e 3929$ WS "{"
7558ebc2
PP
3930$ WS "mkstemp(""foo"");"
3931$ WS "exit(0);"
570bb66e
JH
3932$ WS "}"
3933$ CS
3934$ tmp = "mkstemp"
3935$ GOSUB inlibc
3936$ d_mkstemp = tmp
3937$!
3938$! Check for mkstemps
3939$!
3940$ OS
7558ebc2
PP
3941$ WS "#if defined(__DECC) || defined(__DECCXX)"
3942$ WS "#include <stdlib.h>"
3943$ WS "#endif"
3944$ WS "#include <stdio.h>"
3945$ WS "int main()"
570bb66e 3946$ WS "{"
7558ebc2
PP
3947$ WS "mkstemps(""foo"", 1);"
3948$ WS "exit(0);"
570bb66e
JH
3949$ WS "}"
3950$ CS
3951$ tmp = "mkstemps"
3952$ GOSUB inlibc
3953$ d_mkstemps = tmp
3954$!
570bb66e
JH
3955$! Check for mkdtemp
3956$!
3957$ OS
7558ebc2
PP
3958$ WS "#if defined(__DECC) || defined(__DECCXX)"
3959$ WS "#include <stdlib.h>"
3960$ WS "#endif"
3961$ WS "#include <stdio.h>"
3962$ WS "int main()"
570bb66e 3963$ WS "{"
7558ebc2
PP
3964$ WS "mkdtemp(""foo"");"
3965$ WS "exit(0);"
570bb66e
JH
3966$ WS "}"
3967$ CS
3968$ tmp = "mkdtemp"
3969$ GOSUB inlibc
3970$ d_mkdtemp = tmp
3971$!
3972$! Check for setvbuf
3973$!
3974$ OS
7558ebc2
PP
3975$ WS "#if defined(__DECC) || defined(__DECCXX)"
3976$ WS "#include <stdlib.h>"
3977$ WS "#endif"
3978$ WS "#include <stdio.h>"
3979$ WS "int main()"
570bb66e 3980$ WS "{"
7558ebc2
PP
3981$ WS "FILE *foo;"
3982$ WS "char Buffer[99];"
3983$ WS "foo = fopen(""foo"", ""r"");"
3984$ WS "setvbuf(foo, Buffer, 0, 0);"
3985$ WS "exit(0);"
570bb66e
JH
3986$ WS "}"
3987$ CS
3988$ tmp = "setvbuf"
3989$ GOSUB inlibc
3990$ d_setvbuf = tmp
3991$!
c998f3c7
PP
3992$! see if sfio.h is available
3993$! see if sfio library is available
3994$! Ok, but do we want to use it.
3995$! IF F$TYPE(usesfio) .EQS. "" THEN usesfio = "undef"
3996$! IF val .EQS. "define"
3997$! THEN
3998$! IF usesfio .EQS. "define"
3999$! THEN dflt = "y"
4000$! ELSE dflt = "n"
4001$! ENDIF
4002$! echo "''package' can use the sfio library, but it is experimental."
4003$! IF useperlio .EQS. "undef"
4004$! THEN
4005$! echo "For sfio also the PerlIO abstraction layer is needed."
4006$! echo "Earlier you said you would not want that."
4007$! ENDIF
4008$! rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
4009$! GOSUB myread
4010$! IF ans .EQS. "" THEN ans = dflt
4011$! IF ans
4012$! THEN
4013$! echo "Ok, turning on both sfio and PerlIO, then."
4014$! useperlio="define"
4015$! val="define"
4016$! ELSE
4017$! echo "Ok, avoiding sfio this time. I'll use stdio instead."
4018$! val="undef"
4019$! ENDIF
4020$! ELSE
4021$! IF usesfio .EQS. "define"
4022$! THEN
4023$! echo4 "Sorry, cannot find sfio on this machine."
4024$! echo4 "Ignoring your setting of usesfio=''usesfio'."
4025$! val="undef"
4026$! ENDIF
4027$! ENDIF
4028$!
570bb66e
JH
4029$! Check for setenv
4030$!
4031$ OS
7558ebc2
PP
4032$ WS "#if defined(__DECC) || defined(__DECCXX)"
4033$ WS "#include <stdlib.h>"
4034$ WS "#endif"
4035$ WS "#include <stdio.h>"
4036$ WS "int main()"
570bb66e 4037$ WS "{"
7558ebc2
PP
4038$ WS "setenv(""FOO"", ""BAR"", 0);"
4039$ WS "exit(0);"
570bb66e
JH
4040$ WS "}"
4041$ CS
4042$ tmp = "setenv"
4043$ GOSUB inlibc
4044$ d_setenv = tmp
4045$!
4046$! Check for setproctitle
4047$!
4048$ OS
7558ebc2
PP
4049$ WS "#if defined(__DECC) || defined(__DECCXX)"
4050$ WS "#include <stdlib.h>"
4051$ WS "#endif"
4052$ WS "#include <stdio.h>"
4053$ WS "int main()"
570bb66e 4054$ WS "{"
7558ebc2
PP
4055$ WS "setproctitle(""%s"", ""FOO"");"
4056$ WS "exit(0);"
570bb66e
JH
4057$ WS "}"
4058$ CS
4059$ tmp = "setproctitle"
4060$ GOSUB inlibc
4061$ d_setproctitle = tmp
4062$!
4063$! Check for <netinet/in.h>
4064$!
4065$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4066$ THEN
4067$ tmp = "netinet/in.h"
4068$ GOSUB inhdr
4069$ i_niin = tmp
4070$ ELSE
4071$ i_niin="undef"
4072$ ENDIF
4073$!
4074$! Check for <netinet/tcp.h>
4075$!
4076$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4077$ THEN
4078$ tmp = "netinet/tcp.h"
4079$ GOSUB inhdr
4080$ i_netinettcp = tmp
4081$ ELSE
4082$ i_netinettcp="undef"
4083$ ENDIF
4084$!
4085$! Check for endhostent
4086$!
4087$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4088$ THEN
4089$ OS
7558ebc2
PP
4090$ WS "#if defined(__DECC) || defined(__DECCXX)"
4091$ WS "#include <stdlib.h>"
4092$ WS "#endif"
4093$ WS "#include <stdio.h>"
570bb66e
JH
4094$ IF Has_Socketshr
4095$ THEN WS "#include <socketshr.h>"
7558ebc2 4096$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4097$ ENDIF
7558ebc2 4098$ WS "int main()"
570bb66e 4099$ WS "{"
7558ebc2
PP
4100$ WS "endhostent();"
4101$ WS "exit(0);"
570bb66e
JH
4102$ WS "}"
4103$ CS
4104$ tmp = "endhostent"
4105$ GOSUB inlibc
4106$ d_endhent = tmp
4107$ ELSE
4108$ d_endhent="undef"
4109$ ENDIF
4110$!
4111$! Check for endnetent
4112$!
4113$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4114$ THEN
4115$ OS
7558ebc2
PP
4116$ WS "#if defined(__DECC) || defined(__DECCXX)"
4117$ WS "#include <stdlib.h>"
4118$ WS "#endif"
4119$ WS "#include <stdio.h>"
570bb66e
JH
4120$ IF Has_Socketshr
4121$ THEN WS "#include <socketshr.h>"
7558ebc2 4122$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e
JH
4123$ ENDIF
4124$ WS "int main()"
4125$ WS "{"
4126$ WS "endnetent();"
4127$ WS "exit(0);"
4128$ WS "}"
4129$ CS
4130$ tmp = "endnetent"
4131$ GOSUB inlibc
4132$ d_endnent = tmp
4133$ ELSE
4134$ d_endnent="undef"
4135$ ENDIF
4136$!
4137$! Check for endprotoent
4138$!
4139$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4140$ THEN
4141$ OS
7558ebc2
PP
4142$ WS "#if defined(__DECC) || defined(__DECCXX)"
4143$ WS "#include <stdlib.h>"
4144$ WS "#endif"
4145$ WS "#include <stdio.h>"
570bb66e
JH
4146$ IF Has_Socketshr
4147$ THEN WS "#include <socketshr.h>"
7558ebc2 4148$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4149$ ENDIF
7558ebc2 4150$ WS "int main()"
570bb66e 4151$ WS "{"
7558ebc2
PP
4152$ WS "endprotoent();"
4153$ WS "exit(0);"
570bb66e
JH
4154$ WS "}"
4155$ CS
4156$ tmp = "endprotoent"
4157$ GOSUB inlibc
4158$ d_endpent = tmp
4159$ ELSE
4160$ d_endpent="undef"
4161$ ENDIF
4162$!
4163$! Check for endservent
4164$!
4165$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4166$ THEN
4167$ OS
7558ebc2
PP
4168$ WS "#if defined(__DECC) || defined(__DECCXX)"
4169$ WS "#include <stdlib.h>"
4170$ WS "#endif"
4171$ WS "#include <stdio.h>"
570bb66e
JH
4172$ IF Has_Socketshr
4173$ THEN WS "#include <socketshr.h>"
7558ebc2 4174$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4175$ ENDIF
7558ebc2 4176$ WS "int main()"
570bb66e 4177$ WS "{"
7558ebc2
PP
4178$ WS "endservent();"
4179$ WS "exit(0);"
570bb66e
JH
4180$ WS "}"
4181$ CS
4182$ tmp = "endservent"
4183$ GOSUB inlibc
4184$ d_endsent = tmp
4185$ ELSE
4186$ d_endsent="undef"
4187$ ENDIF
4188$!
4189$! Check for sethostent
4190$!
4191$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4192$ THEN
4193$ OS
7558ebc2
PP
4194$ WS "#if defined(__DECC) || defined(__DECCXX)"
4195$ WS "#include <stdlib.h>"
4196$ WS "#endif"
4197$ WS "#include <stdio.h>"
570bb66e
JH
4198$ IF Has_Socketshr
4199$ THEN WS "#include <socketshr.h>"
7558ebc2 4200$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4201$ ENDIF
7558ebc2 4202$ WS "int main()"
570bb66e 4203$ WS "{"
7558ebc2
PP
4204$ WS "sethostent(1);"
4205$ WS "exit(0);"
570bb66e
JH
4206$ WS "}"
4207$ CS
4208$ tmp = "sethostent"
4209$ GOSUB inlibc
4210$ d_sethent = tmp
4211$ ELSE
4212$ d_sethent="undef"
4213$ ENDIF
4214$!
4215$! Check for setnetent
4216$!
4217$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4218$ THEN
4219$ OS
7558ebc2
PP
4220$ WS "#if defined(__DECC) || defined(__DECCXX)"
4221$ WS "#include <stdlib.h>"
4222$ WS "#endif"
4223$ WS "#include <stdio.h>"
570bb66e
JH
4224$ IF Has_Socketshr
4225$ THEN WS "#include <socketshr.h>"
7558ebc2 4226$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4227$ ENDIF
7558ebc2 4228$ WS "int main()"
570bb66e 4229$ WS "{"
7558ebc2
PP
4230$ WS "setnetent(1);"
4231$ WS "exit(0);"
570bb66e
JH
4232$ WS "}"
4233$ CS
4234$ tmp = "setnetent"
4235$ GOSUB inlibc
4236$ d_setnent = tmp
4237$ ELSE
4238$ d_setnent="undef"
4239$ ENDIF
4240$!
4241$! Check for setprotoent
4242$!
4243$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4244$ THEN
4245$ OS
7558ebc2
PP
4246$ WS "#if defined(__DECC) || defined(__DECCXX)"
4247$ WS "#include <stdlib.h>"
4248$ WS "#endif"
4249$ WS "#include <stdio.h>"
570bb66e
JH
4250$ IF Has_Socketshr
4251$ THEN WS "#include <socketshr.h>"
7558ebc2 4252$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4253$ ENDIF
7558ebc2 4254$ WS "int main()"
570bb66e 4255$ WS "{"
7558ebc2
PP
4256$ WS "setprotoent(1);"
4257$ WS "exit(0);"
570bb66e
JH
4258$ WS "}"
4259$ CS
4260$ tmp = "setprotoent"
4261$ GOSUB inlibc
4262$ d_setpent = tmp
4263$ ELSE
4264$ d_setpent="undef"
4265$ ENDIF
4266$!
4267$! Check for setservent
4268$!
4269$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4270$ THEN
4271$ OS
7558ebc2
PP
4272$ WS "#if defined(__DECC) || defined(__DECCXX)"
4273$ WS "#include <stdlib.h>"
4274$ WS "#endif"
4275$ WS "#include <stdio.h>"
570bb66e
JH
4276$ IF Has_Socketshr
4277$ THEN WS "#include <socketshr.h>"
7558ebc2 4278$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4279$ ENDIF
7558ebc2 4280$ WS "int main()"
570bb66e 4281$ WS "{"
7558ebc2
PP
4282$ WS "setservent(1);"
4283$ WS "exit(0);"
570bb66e
JH
4284$ WS "}"
4285$ CS
4286$ tmp = "setservent"
4287$ GOSUB inlibc
4288$ d_setsent = tmp
4289$ ELSE
4290$ d_setsent="undef"
4291$ ENDIF
4292$!
4293$! Check for gethostent
4294$!
4295$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4296$ THEN
4297$ OS
7558ebc2
PP
4298$ WS "#if defined(__DECC) || defined(__DECCXX)"
4299$ WS "#include <stdlib.h>"
4300$ WS "#endif"
4301$ WS "#include <stdio.h>"
570bb66e
JH
4302$ IF Has_Socketshr
4303$ THEN WS "#include <socketshr.h>"
7558ebc2 4304$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4305$ ENDIF
7558ebc2 4306$ WS "int main()"
570bb66e 4307$ WS "{"
7558ebc2
PP
4308$ WS "gethostent();"
4309$ WS "exit(0);"
570bb66e
JH
4310$ WS "}"
4311$ CS
4312$ tmp = "gethostent"
4313$ GOSUB inlibc
4314$ d_gethent = tmp
4315$ ELSE
4316$ d_gethent="undef"
4317$ ENDIF
4318$!
4319$! Check for getnetent
4320$!
4321$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4322$ THEN
4323$ OS
7558ebc2
PP
4324$ WS "#if defined(__DECC) || defined(__DECCXX)"
4325$ WS "#include <stdlib.h>"
4326$ WS "#endif"
4327$ WS "#include <stdio.h>"
570bb66e
JH
4328$ IF Has_Socketshr
4329$ THEN WS "#include <socketshr.h>"
7558ebc2 4330$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4331$ ENDIF
7558ebc2 4332$ WS "int main()"
570bb66e 4333$ WS "{"
7558ebc2
PP
4334$ WS "getnetent();"
4335$ WS "exit(0);"
570bb66e
JH
4336$ WS "}"
4337$ CS
4338$ tmp = "getnetent"
4339$ GOSUB inlibc
4340$ d_getnent = tmp
4341$ ELSE
4342$ d_getnent="undef"
4343$ ENDIF
4344$!
4345$! Check for getprotoent
4346$!
4347$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4348$ THEN
4349$ OS
7558ebc2
PP
4350$ WS "#if defined(__DECC) || defined(__DECCXX)"
4351$ WS "#include <stdlib.h>"
4352$ WS "#endif"
4353$ WS "#include <stdio.h>"
570bb66e
JH
4354$ IF Has_Socketshr
4355$ THEN WS "#include <socketshr.h>"
7558ebc2 4356$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4357$ ENDIF
7558ebc2 4358$ WS "int main()"
570bb66e 4359$ WS "{"
7558ebc2
PP
4360$ WS "getprotoent();"
4361$ WS "exit(0);"
570bb66e
JH
4362$ WS "}"
4363$ CS
4364$ tmp = "getprotoent"
4365$ GOSUB inlibc
4366$ d_getpent = tmp
4367$ ELSE
4368$ d_getpent="undef"
4369$ ENDIF
4370$!
4371$! Check for getservent
4372$!
4373$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4374$ THEN
4375$ OS
7558ebc2
PP
4376$ WS "#if defined(__DECC) || defined(__DECCXX)"
4377$ WS "#include <stdlib.h>"
4378$ WS "#endif"
4379$ WS "#include <stdio.h>"
570bb66e
JH
4380$ IF Has_Socketshr
4381$ THEN WS "#include <socketshr.h>"
7558ebc2 4382$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4383$ ENDIF
7558ebc2 4384$ WS "int main()"
570bb66e 4385$ WS "{"
7558ebc2
PP
4386$ WS "getservent();"
4387$ WS "exit(0);"
570bb66e
JH
4388$ WS "}"
4389$ CS
4390$ tmp = "getservent"
4391$ GOSUB inlibc
4392$ d_getsent = tmp
4393$ ELSE
4394$ d_getsent="undef"
4395$ ENDIF
4396$!
4397$! Check for socklen_t
4398$!
4399$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4400$ THEN
4401$ echo4 "Checking to see if you have socklen_t..."
4402$ OS
7558ebc2
PP
4403$ WS "#if defined(__DECC) || defined(__DECCXX)"
4404$ WS "#include <stdlib.h>"
4405$ WS "#endif"
4406$ WS "#include <stdio.h>"
570bb66e
JH
4407$ IF Has_Socketshr
4408$ THEN WS "#include <socketshr.h>"
7558ebc2 4409$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4410$ ENDIF
7558ebc2 4411$ WS "int main()"
570bb66e 4412$ WS "{"
7558ebc2
PP
4413$ WS "socklen_t x = 16;"
4414$ WS "exit(0);"
570bb66e
JH
4415$ WS "}"
4416$ CS
4417$ GOSUB link_ok
4418$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4419$ THEN
4420$ d_socklen_t="define"
4421$ echo "You have socklen_t."
4422$ ELSE
4423$ d_socklen_t="undef"
4424$ echo "You do not have socklen_t."
4425$ ENDIF
4426$ ELSE
4427$ d_socklen_t="undef"
4428$ ENDIF
4429$!
4430$! Check for pthread_yield
4431$!
4432$ IF use_threads
4433$ THEN
4434$ OS
7558ebc2
PP
4435$ WS "#if defined(__DECC) || defined(__DECCXX)"
4436$ WS "#include <stdlib.h>"
4437$ WS "#endif"
4438$ WS "#include <pthread.h>"
4439$ WS "#include <stdio.h>"
4440$ WS "int main()"
570bb66e 4441$ WS "{"
7558ebc2
PP
4442$ WS "pthread_yield();"
4443$ WS "exit(0);"
570bb66e
JH
4444$ WS "}"
4445$ CS
4446$ tmp = "pthread_yield"
4447$ GOSUB inlibc
4448$ d_pthread_yield = tmp
4449$ ELSE
4450$ d_pthread_yield="undef"
4451$ ENDIF
4452$!
4453$! Check for sched_yield
4454$!
4455$ IF use_threads
4456$ THEN
4457$ OS
7558ebc2
PP
4458$ WS "#if defined(__DECC) || defined(__DECCXX)"
4459$ WS "#include <stdlib.h>"
4460$ WS "#endif"
4461$ WS "#include <pthread.h>"
4462$ WS "#include <stdio.h>"
4463$ WS "int main()"
570bb66e 4464$ WS "{"
7558ebc2
PP
4465$ WS "sched_yield();"
4466$ WS "exit(0);"
570bb66e
JH
4467$ WS "}"
4468$ CS
4469$ tmp = "sched_yield"
4470$ GOSUB inlibc
4471$ d_sched_yield = tmp
4472$ IF d_sched_yield .EQS. "define"
4473$ THEN sched_yield = "sched_yield"
4474$ ELSE sched_yield = " "
4475$ ENDIF
4476$ ELSE
4477$ d_sched_yield="undef"
4478$ sched_yield = " "
4479$ ENDIF
4480$!
4481$! Check for generic pointer size
4482$!
4483$ echo4 "Checking to see how big your pointers are..."
4484$ OS
7558ebc2
PP
4485$ WS "#if defined(__DECC) || defined(__DECCXX)"
4486$ WS "#include <stdlib.h>"
4487$ WS "#endif"
4488$ WS "#include <stdio.h>"
4489$ WS "int main()"
570bb66e 4490$ WS "{"
7558ebc2
PP
4491$ WS "int foo;"
4492$ WS "foo = sizeof(char *);"
4493$ WS "printf(""%d\n"", foo);"
4494$ WS "exit(0);"
570bb66e
JH
4495$ WS "}"
4496$ CS
4497$ tmp = "char *"
4498$ GOSUB type_size_check
4499$ ptrsize = tmp
4500$ echo "Your pointers are ''ptrsize' bytes long."
4501$!
4502$! Check for size_t size
4503$!
4504$ tmp = "size_t"
4505$ zzz = tmp
4506$ echo4 "Checking the size of ''zzz'..."
4507$ GOSUB type_size_check
4508$ sizesize = tmp
4509$ echo "Your ''zzz' size is ''sizesize' bytes."
4510$!
4511$! Check rand48 and its ilk
4512$!
4513$ echo4 "Looking for a random number function..."
4514$ OS
7558ebc2
PP
4515$ WS "#if defined(__DECC) || defined(__DECCXX)"
4516$ WS "#include <stdlib.h>"
4517$ WS "#endif"
4518$ WS "#include <stdio.h>"
4519$ WS "int main()"
570bb66e
JH
4520$ WS "{"
4521$ WS "srand48(12L);"
7558ebc2 4522$ WS "exit(0);"
570bb66e
JH
4523$ WS "}"
4524$ CS
4525$ GOSUB link_ok
4526$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4527$ THEN
4528$ drand01 = "drand48()"
4529$ randseedtype = "long int"
4530$ seedfunc = "srand48"
4531$ echo4 "Good, found drand48()."
4532$ d_drand48proto = "define"
4533$ ELSE
4534$ d_drand48proto = "undef"
4535$ drand01="random()"
4536$ randseedtype = "unsigned"
4537$ seedfunc = "srandom"
4538$ OS
7558ebc2
PP
4539$ WS "#if defined(__DECC) || defined(__DECCXX)"
4540$ WS "#include <stdlib.h>"
4541$ WS "#endif"
4542$ WS "#include <stdio.h>"
4543$ WS "int main()"
570bb66e
JH
4544$ WS "{"
4545$ WS "srandom(12);"
7558ebc2 4546$ WS "exit(0);"
570bb66e
JH
4547$ WS "}"
4548$ CS
4549$ GOSUB link_ok
4550$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4551$ THEN
4552$ echo4 "OK, found random()."
4553$ ELSE
96e176bf 4554$ drand01="(((float)rand())*MY_INV_RAND_MAX)"
570bb66e
JH
4555$ randseedtype = "unsigned"
4556$ seedfunc = "srand"
4557$ echo4 "Yick, looks like I have to use rand()."
4558$ ENDIF
4559$ ENDIF
570bb66e
JH
4560$! Done with compiler checks. Clean up.
4561$ IF F$SEARCH("try.c") .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
4562$ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
4563$ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
4564$ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
4565$ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
414b89cc 4566$ IF ccname .EQS. "CXX"
570bb66e
JH
4567$ THEN
4568$ CALL Cxx_demangler_cleanup
4569$ ENDIF
4570$!
4571$! Some that are compiler or VMS version sensitive
4572$!
4573$! Gnu C stuff
414b89cc 4574$ IF ccname .EQS. "GCC"
570bb66e
JH
4575$ THEN
4576$ d_attribut="define"
4577$ vms_cc_type="gcc"
4578$ ELSE
4579$ vms_cc_type="cc"
4580$ d_attribut="undef"
4581$ ENDIF
4582$!
4583$! Dec C >= 5.2 and VMS ver >= 7.0
414b89cc
CB
4584$ IF (ccname .EQS. "DEC") .AND. -
4585 (F$INTEGER(Dec_C_Version).GE.50200000) .AND. (vms_ver .GES. "7.0")
570bb66e
JH
4586$ THEN
4587$ d_bcmp="define"
10eefe7f 4588$ d_getitimer="define"
570bb66e 4589$ d_gettimeod="define"
10eefe7f
CB
4590$ d_mmap="define"
4591$ d_mprotect="define"
4592$ d_munmap="define"
4593$ d_msync="define"
4594$ d_ualarm="define"
570bb66e 4595$ d_uname="define"
10eefe7f
CB
4596$ d_usleep="define"
4597$ d_setitimer="define"
570bb66e 4598$ d_sigaction="define"
983dbef6 4599$ d_sigprocmask="define"
570bb66e
JH
4600$ d_truncate="define"
4601$ d_wait4="define"
4602$ d_index="define"
4603$ pidtype="pid_t"
4604$ 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"
4605$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4606$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",""SPARE18"",""SPARE19"",""CHLD"",""CONT"",""STOP"",""TSTP"","
4607$ psnwc3="""TTIN"",""TTOU"",""DEBUG"",""SPARE27"",""SPARE28"",""SPARE29"",""SPARE30"",""SPARE31"",""SPARE32"",""RTMIN"",""RTMAX"",0"
4608$ sig_name_init = psnwc1 + psnwc2 + psnwc3
7558ebc2 4609$ 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
4610$ 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"
4611$! perl_sig_num_with_commas=sig_num_init
6feaf546 4612$ sig_size="36"
570bb66e
JH
4613$ uidtype="uid_t"
4614$ d_pathconf="define"
4615$ d_fpathconf="define"
4616$ d_sysconf="define"
4617$ d_sigsetjmp="define"
4618$ ELSE
4619$ pidtype="unsigned int"
570bb66e 4620$ d_bcmp="undef"
10eefe7f
CB
4621$ d_getitimer="undef"
4622$ d_gettimeod="undef"
4623$ d_mmap="undef"
4624$ d_mprotect="undef"
4625$ d_munmap="undef"
4626$ d_msync="undef"
4627$ d_ualarm="undef"
570bb66e 4628$ d_uname="undef"
10eefe7f
CB
4629$ d_usleep="undef"
4630$ d_setitimer="undef"
570bb66e 4631$ d_sigaction="undef"
983dbef6 4632$ d_sigprocmask="undef"
570bb66e
JH
4633$ d_truncate="undef"
4634$ d_wait4="undef"
4635$ d_index="undef"
4636$ sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4637$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4638$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4639$ sig_name_init = psnwc1 + psnwc2
4640$ sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"",0"
4641$ sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
4642$! perl_sig_num_with_commas=sig_num_init
6feaf546 4643$ sig_size="19"
570bb66e
JH
4644$ uidtype="unsigned int"
4645$ d_pathconf="undef"
4646$ d_fpathconf="undef"
4647$ d_sysconf="undef"
4648$ d_sigsetjmp="undef"
4649$ ENDIF
a3bd614a
PP
4650$!: see if tzname[] exists
4651$ OS
4652$ WS "#include <stdio.h>"
4653$ WS "#include <time.h>"
4654$ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
4655$ CS
4656$ GOSUB compile_ok
4657$ IF compile_status .EQ. good_compile
4658$ THEN
4659$ d_tzname = "undef"
4660$ echo4 "tzname[] NOT found."
4661$ ELSE
4662$ d_tzname = "define"
4663$ echo4 "tzname[] found."
4664$ ENDIF
4665$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
570bb66e 4666$!
414b89cc
CB
4667$ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
4668$ THEN
4669$ d_phostname="define"
4670$ ELSE
4671$ d_phostname="undef"
4672$ ENDIF
4673$!
570bb66e 4674$! Dec C alone
414b89cc 4675$ IF ccname .EQS. "DEC"
570bb66e
JH
4676$ THEN
4677$ d_mbstowcs="define"
4678$ d_mbtowc="define"
4679$ d_stdiobase="define"
4680$ d_stdio_cnt_lval="define"
dedcc4d4 4681$ d_stdio_ptr_lval="define"
570bb66e
JH
4682$ d_stdstdio="define"
4683$ d_wcstombs="define"
4684$ d_mblen="define"
4685$ d_mktime="define"
4686$ d_strcoll="define"
4687$ d_strxfrm="define"
4688$ d_wctomb="define"
4689$ i_locale="define"
2765b840 4690$ i_langinfo="define"
570bb66e 4691$ d_locconv="define"
2765b840 4692$ d_nl_langinfo="define"
570bb66e
JH
4693$ d_setlocale="define"
4694$ vms_cc_type="decc"
4695$ ELSE
4696$ d_mbstowcs="undef"
4697$ d_mbtowc="undef"
4698$ d_stdiobase="undef"
4699$ d_stdio_cnt_lval="undef"
4700$ d_stdio_ptr_lval="undef"
4701$ d_stdstdio="undef"
4702$ d_wcstombs="undef"
4703$ d_mblen="undef"
4704$ d_mktime="undef"
4705$ d_strcoll="undef"
4706$ d_strxfrm="undef"
4707$ d_wctomb="undef"
4708$ i_locale="undef"
2765b840 4709$ i_langinfo="undef"
570bb66e 4710$ d_locconv="undef"
2765b840 4711$ d_nl_langinfo="undef"
570bb66e
JH
4712$ d_setlocale="undef"
4713$ ENDIF
a7ffa9b9 4714$ d_stdio_ptr_lval_sets_cnt="undef"
a15cef0c 4715$ d_stdio_ptr_lval_nochange_cnt="define"
570bb66e
JH
4716$!
4717$! Sockets?
4718$ if Has_Socketshr .OR. Has_Dec_C_Sockets
4719$ THEN
4720$ d_vms_do_sockets="define"
4721$ d_htonl="define"
4722$ d_socket="define"
4723$ d_select="define"
4724$ netdb_hlen_type="int"
4725$ netdb_host_type="char *"
4726$ netdb_name_type="char *"
4727$ netdb_net_type="long"
4728$ d_gethbyaddr="define"
4729$ d_gethbyname="define"
4730$ d_getnbyaddr="define"
4731$ d_getnbyname="define"
4732$ d_getpbynumber="define"
4733$ d_getpbyname="define"
4734$ d_getsbyport="define"
4735$ d_getsbyname="define"
4736$ d_gethostprotos="define"
4737$ d_getnetprotos="define"
4738$ d_getprotoprotos="define"
4739$ d_getservprotos="define"
414b89cc 4740$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
570bb66e
JH
4741$ THEN
4742$ socksizetype="unsigned int"
4743$ ELSE
4744$ socksizetype="int *"
4745$ ENDIF
4746$ ELSE
4747$ d_vms_do_sockets="undef"
4748$ d_htonl="undef"
4749$ d_socket="undef"
4750$ d_select="undef"
4751$ netdb_hlen_type="int"
4752$ netdb_host_type="char *"
4753$ netdb_name_type="char *"
4754$ netdb_net_type="long"
4755$ d_gethbyaddr="undef"
4756$ d_gethbyname="undef"
4757$ d_getnbyaddr="undef"
4758$ d_getnbyname="undef"
4759$ d_getpbynumber="undef"
4760$ d_getpbyname="undef"
4761$ d_getsbyport="undef"
4762$ d_getsbyname="undef"
4763$ d_gethostprotos="undef"
4764$ d_getnetprotos="undef"
4765$ d_getprotoprotos="undef"
4766$ d_getservprotos="undef"
4767$ socksizetype="undef"
4768$ ENDIF
4769$! Threads
4770$ IF use_threads
4771$ THEN
4772$ usethreads="define"
4773$ d_pthreads_created_joinable="define"
4774$ if (vms_ver .GES. "7.0")
4775$ THEN
4776$ d_oldpthreads="undef"
4777$ ELSE
4778$ d_oldpthreads="define"
4779$ ENDIF
4780$ ELSE
4781$ d_oldpthreads="undef"
4782$ usethreads="undef"
4783$ d_pthreads_created_joinable="undef"
4784$ ENDIF
4785$!
4786$! new (5.005_62++) typedefs for primitives
4787$!
4788$ echo "Choosing the C types to be used for Perl's internal types..."
4789$ ivtype="long"
4790$ uvtype="unsigned long"
4791$ i8type="char"
4792$ u8type="unsigned char"
4793$ i16type="short"
4794$ u16type="unsigned short"
4795$ i32type="int"
4796$ u32type="unsigned int"
4797$ i64type="long long"
4798$ u64type="unsigned long long"
4799$ nvtype="double"
4800$!
4801$ IF use64bitint .OR. use64bitint .EQS. "define"
4802$ THEN
4803$ ivtype = "''i64type'"
4804$ uvtype = "''u64type'"
4805$ nvtype="long double"
4806$ ELSE
4807$ i64size="undef"
4808$ u64size="undef"
4809$ ENDIF
4810$!
4811$ tmp = "''ivtype'"
4812$ GOSUB type_size_check
4813$ ivsize = tmp
4814$ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
4815$ IF ivtype .eqs. "long"
4816$ THEN longsize = tmp
4817$ ELSE
4818$ tmp = "long"
4819$ GOSUB type_size_check
4820$ longsize = tmp
4821$ ENDIF
7558ebc2 4822$!
570bb66e
JH
4823$ tmp = "''uvtype'"
4824$ GOSUB type_size_check
4825$ uvsize = tmp
4826$ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
7558ebc2 4827$!
570bb66e
JH
4828$ tmp = "''i8type'"
4829$ GOSUB type_size_check
4830$ i8size = tmp
7558ebc2 4831$!
570bb66e
JH
4832$ tmp = "''u8type'"
4833$ GOSUB type_size_check
4834$ u8size = tmp
7558ebc2 4835$!
570bb66e
JH
4836$ tmp = "''i16type'"
4837$ GOSUB type_size_check
4838$ i16size = tmp
4839$ IF i16type .eqs. "short"
4840$ THEN shortsize = tmp
4841$ ELSE
4842$ tmp = "short"
4843$ gosub type_size_check
4844$ shortsize = tmp
4845$ ENDIF
7558ebc2 4846$!
570bb66e
JH
4847$ tmp = "''u16type'"
4848$ GOSUB type_size_check
4849$ u16size = tmp
7558ebc2 4850$!
570bb66e
JH
4851$ tmp = "''i32type'"
4852$ GOSUB type_size_check
4853$ i32size = tmp
4854$ IF i32type .eqs. "int"
4855$ THEN intsize = tmp
4856$ ELSE
4857$ tmp = "int"
4858$ gosub type_size_check
4859$ intsize = tmp
4860$ ENDIF
7558ebc2 4861$!
570bb66e
JH
4862$ tmp = "''u32type'"
4863$ gosub type_size_check
4864$ u32size = tmp
7558ebc2 4865$!
570bb66e
JH
4866$ tmp = "''nvtype'"
4867$ GOSUB type_size_check
4868$ nvsize = tmp
4869$!
4870$ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
4871$ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
4872$ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
4873$!
4874$ echo4 "Checking whether your NVs can preserve your UVs..."
4875$ OS
7558ebc2
PP
4876$ WS "#if defined(__DECC) || defined(__DECCXX)"
4877$ WS "#include <stdlib.h>"
4878$ WS "#endif"
4879$ WS "#include <stdio.h>"
4880$ WS "int main() {"
4881$ WS " ''uvtype' k = (''uvtype')~0, l;"
4882$ WS " ''nvtype' d;"
4883$ WS " l = k;"
4884$ WS " d = (''nvtype')l;"
4885$ WS " l = (''uvtype')d;"
4886$ WS " if (l == k)"
4887$ WS " printf(""preserve\n"");"
4888$ WS " exit(0);"
4889$ WS "}"
570bb66e
JH
4890$ CS
4891$ GOSUB compile
4892$ IF tmp .EQS. "preserve"
4893$ THEN
4894$ d_nv_preserves_uv = "define"
4895$ echo "Yes, they can."
4896$ d_nv_preserves_uv_bits = F$STRING(F$INTEGER(uvsize) * 8)
4897$ ELSE
4898$ d_nv_preserves_uv = "undef"
4899$ echo "No, they can't."
4900$ echo4 "Checking how many bits of your UVs your NVs can preserve..."
4901$ OS
7558ebc2
PP
4902$ WS "#if defined(__DECC) || defined(__DECCXX)"
4903$ WS "#include <stdlib.h>"
4904$ WS "#endif"
4905$ WS "#include <stdio.h>"
4906$ WS "int main() {"
4907$ WS " ''uvtype' u = 0;"
4908$ WS " int n = 8 * ''uvsize';"
4909$ WS " int i;"
4910$ WS " for (i = 0; i < n; i++) {"
4911$ WS " u = u << 1 | (''uvtype')1;"
4912$ WS " if ((''uvtype')(''nvtype')u != u)"
4913$ WS " break;"
4914$ WS " }"
4915$ WS " printf(""%d\n"", i);"
4916$ WS " exit(0);"
4917$ WS "}"
f2610a60 4918$ CS
570bb66e
JH
4919$ GOSUB compile
4920$ d_nv_preserves_uv_bits = tmp
4921$ ENDIF
f2610a60
CL
4922$!
4923$ echo4 "Checking whether your kill() uses SYS$FORCEX..."
4924$ kill_by_sigprc = "undef"
4925$ OS
4926$ WS "#include <stdio.h>"
4927$ WS "#include <signal.h>"
4928$ WS "void handler(int s) { printf(""%d\n"",s); } "
4929$ WS "main(){"
4930$ WS " printf(""0"");"
4931$ WS " signal(1,handler); kill(0,1);"
4932$ WS "}"
4933$ CS
4934$ ON ERROR THEN CONTINUE
4935$ GOSUB compile
4936$ IF tmp .NES. "01"
4937$ THEN
4938$ echo "Yes, it does."
4939$ echo4 "Checking whether we can use SYS$SIGPRC instead"
4940$ OS
4941$ WS "#include <stdio.h>"
4942$ WS "#include <lib$routines.h>"
4943$ WS "unsigned long code = 0;"
4944$ WS "int handler(unsigned long *args) {"
4945$ WS " code = args[1];"
4946$ WS " return 1;"
4947$ WS "}"
4948$ WS "main() { "
4949$ WS " int iss, sys$sigprc();"
4950$ WS " lib$establish(handler);"
4951$ WS " iss = sys$sigprc(0,0,0x1234);"
4952$ WS " iss = ((iss&1)==1 && code == 0x1234);"
4953$ WS " printf(""%d\n"",iss);"
4954$ WS "}"
4955$ CS
4956$ GOSUB compile
4957$ IF tmp .EQS. "1"
4958$ THEN
4959$ echo "looks like we can"
4960$ kill_by_sigprc = "define"
4961$!
4962$! since SIGBUS and SIGSEGV indistinguishable, make them the same here.
4963$! sigusr1 and sigusr2 show up in VMS6.2 and later
4964$!
4965$ if vms_ver .GES. "6.2"
4966$ then
4967$ sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4968$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4969$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4970$ sig_name_init = psnwc1 + psnwc2
4971$ sig_num="0 1 2 3 4 5 6 7 8 9 10 10 12 13 14 15 6 16 17"",0"
4972$ sig_num_init="0,1,2,3,4,5,6,7,8,9,10,10,12,13,14,15,6,16,17,0"
4973$ sig_size="19"
4974$ else
4975$ sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT"",0"
4976$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4977$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",0"
4978$ sig_name_init = psnwc1 + psnwc2
4979$ sig_num="0 1 2 3 4 5 6 7 8 9 10 10 12 13 14 15 6"",0"
4980$ sig_num_init="0,1,2,3,4,5,6,7,8,9,10,10,12,13,14,15,6,0"
4981$ sig_size="17"
4982$ endif
4983$ ENDIF
4984$ ENDIF
570bb66e
JH
4985$ DELETE/SYMBOL tmp
4986$!
570bb66e
JH
4987$! Finally the composite ones. All config
4988$!
4989$ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
4990$!
414b89cc 4991$ IF ccname .EQS. "DEC"
570bb66e 4992$ THEN
a71134cc 4993$ ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
570bb66e 4994$ ENDIF
7558ebc2 4995$ i_dirent = "undef"
414b89cc 4996$ IF ccname .EQS. "CXX"
7558ebc2
PP
4997$ THEN
4998$ i_dirent = "define"
a71134cc 4999$ ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
7558ebc2 5000$ ENDIF
570bb66e
JH
5001$ IF use_vmsdebug_perl
5002$ THEN
a71134cc 5003$ optimize="/List/Debug/NoOpt"
31963e90 5004$ ldflags="/Debug/Trace/Map"
570bb66e
JH
5005$ dbgprefix = "DBG"
5006$ ELSE
a71134cc 5007$ optimize= "/NoList"
31963e90 5008$ ldflags="/NoTrace/NoMap"
570bb66e
JH
5009$ dbgprefix = ""
5010$ ENDIF
5011$!
5012$! Okay, we've got everything configured. Now go write out a config.sh.
5013$ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
5014$ echo4 "Creating ''basename_config_sh'..."
7558ebc2 5015$ open/write CONFIG 'config_sh'
570bb66e
JH
5016$ WC := write CONFIG
5017$!
5018$! ##BEGIN WRITE NEW CONSTANTS HERE##
5019$!
5020$ WC "#!/bin/sh"
5021$ WC "#"
5022$ WC "# This file was produced by Configure.COM on a ''osname' system."
5023$ WC "#"
5024$ WC "# Package name : ''package'"
5025$ WC "# Source directory : ''src'"
5026$ WC "# Configuration time: " + cf_time
5027$ WC "# Configuration by : " + cf_by
5028$ WC "# Target system : " + myuname
5029$ WC ""
5030$ WC "CONFIG='true'"
5031$ WC "Makefile_SH='" + Makefile_SH + "'"
5032$ WC "Mcc='" + Mcc + "'"
414b89cc
CB
5033$ WC "PERL_REVISION='" + revision + "'"
5034$ WC "PERL_VERSION='" + patchlevel + "'"
5035$ WC "PERL_SUBVERSION='" + subversion + "'"
5036$ WC "PERL_API_VERSION='" + api_version + "'"
5037$ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
570bb66e 5038$ WC "alignbytes='" + alignbytes + "'"
414b89cc 5039$ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
570bb66e
JH
5040$ WC "ar='" + "'"
5041$ WC "archlib='" + archlib + "'"
5042$ WC "archlibexp='" + archlibexp + "'"
5043$ WC "archname='" + archname + "'"
5044$ WC "baserev='" + baserev + "'"
5045$ WC "bin='" + bin + "'"
5046$ WC "binexp='" + binexp + "'"
5047$ WC "builddir='" + builddir + "'"
5048$ WC "byteorder='1234'"
5049$ WC "castflags='0'"
5050$ WC "cc='" + perl_cc + "'"
5051$ WC "cccdlflags='" + cccdlflags + "'"
5052$ WC "ccdlflags='" + ccdlflags + "'"
5053$ WC "ccflags='" + ccflags + "'"
414b89cc 5054$ WC "ccname='" + ccname + "'"
7558ebc2 5055$ WC "ccversion='" + ccversion + "'"
570bb66e
JH
5056$ WC "cf_by='" + cf_by + "'"
5057$ WC "cf_email='" + cf_email + "'"
5058$ WC "cf_time='" + cf_time + "'"
5059$ WC "config_args='" + config_args + "'"
5060$ WC "config_sh='" + config_sh + "'"
5061$ WC "cpp_stuff='" + cpp_stuff + "'"
5062$ WC "cpplast='" + cpplast + "'"
5063$ WC "cppminus='" + cppminus + "'"
5064$ WC "cpprun='" + cpprun + "'"
5065$ WC "cppstdin='" + cppstdin + "'"
9fd42072 5066$ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
6b356c8e
JH
5067$ WC "d_PRIEldbl='" + d_PRIEUldbl + "'"
5068$ WC "d_PRIFldbl='" + d_PRIFUldbl + "'"
5069$ WC "d_PRIGldbl='" + d_PRIGUldbl + "'"
842bcadf 5070$ WC "d_PRIXU64='" + d_PRIXU64 + "'"
2ef53570 5071$ WC "d_PRId64='" + d_PRId64 + "'"
59a27e12 5072$ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
570bb66e
JH
5073$ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
5074$ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
5075$ WC "d_PRIo64='" + d_PRIo64 + "'"
5076$ WC "d_PRIu64='" + d_PRIu64 + "'"
5077$ WC "d_PRIx64='" + d_PRIx64 + "'"
b5ddfb46 5078$ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
2ef53570 5079$ WC "d__fwalk='undef'"
570bb66e
JH
5080$ WC "d_access='" + d_access + "'"
5081$ WC "d_accessx='undef'"
5082$ WC "d_alarm='define'"
5083$ WC "d_archlib='define'"
5084$ WC "d_atolf='" + d_atolf + "'"
5085$ WC "d_atoll='" + d_atoll + "'"
5086$ WC "d_attribut='" + d_attribut + "'"
5087$ WC "d_bcmp='" + d_bcmp + "'"
5088$ WC "d_bcopy='" + d_bcopy + "'"
5089$ WC "d_bincompat3='undef'"
5090$ WC "d_bincompat5005='undef'"
570bb66e 5091$! WC "d_bsdpgrp='undef'"
2ef53570 5092$ WC "d_bsdgetpgrp='undef'"
570bb66e
JH
5093$ WC "d_bsdsetpgrp='undef'"
5094$ WC "d_bzero='" + d_bzero + "'"
5095$ WC "d_casti32='define'"
5096$ WC "d_castneg='define'"
5097$ WC "d_charvspr='undef'"
5098$ WC "d_chown='define'"
5099$ WC "d_chroot='undef'"
5100$ WC "d_chsize='undef'"
758a5d79 5101$ WC "d_class='undef'"
570bb66e
JH
5102$ WC "d_cmsghdr_s='undef'"
5103$ WC "d_const='define'"
5104$ WC "d_crypt='define'"
5105$ WC "d_csh='undef'"
5106$ WC "d_cuserid='define'"
5107$ WC "d_dbl_dig='define'"
2ef53570 5108$ WC "d_dbminitproto='undef'"
570bb66e 5109$ WC "d_difftime='define'"
a838cfe5 5110$ WC "d_dirfd='undef'"
570bb66e
JH
5111$ WC "d_dirnamlen='define'"
5112$ WC "d_dlerror='undef'"
5113$ WC "d_dlsymun='undef'"
5114$ WC "d_dosuid='undef'"
5115$ WC "d_drand48proto='" + d_drand48proto + "'"
5116$ WC "d_dup2='define'"
5117$ WC "d_eaccess='undef'"
5118$ WC "d_endgrent='define'"
5119$ WC "d_endhent='" + d_endhent + "'"
5120$ WC "d_endnent='" + d_endnent + "'"
5121$ WC "d_endpent='" + d_endpent + "'"
5122$ WC "d_endpwent='define'"
5123$ WC "d_endsent='" + d_endsent + "'"
5124$ WC "d_eofnblk='undef'"
5125$ WC "d_eunice='undef'"
5126$ WC "d_fchmod='undef'"
b363b713 5127$ WC "d_fchdir='undef'"
570bb66e
JH
5128$ WC "d_fchown='undef'"
5129$ WC "d_fcntl='" + d_fcntl + "'"
1c21a19a 5130$ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
570bb66e
JH
5131$ WC "d_fd_set='" + d_fd_set + "'"
5132$ WC "d_fgetpos='define'"
758a5d79
JH
5133$ WC "d_finite='undef'"
5134$ WC "d_finitel='undef'"
570bb66e
JH
5135$ WC "d_flexfnam='define'"
5136$ WC "d_flock='undef'"
2ef53570 5137$ WC "d_flockproto='undef'"
570bb66e 5138$ WC "d_fork='undef'"
758a5d79 5139$ WC "d_fp_class='undef'"
570bb66e 5140$ WC "d_fpathconf='" + d_fpathconf + "'"
758a5d79
JH
5141$ WC "d_fpclass='undef'"
5142$ WC "d_fpclassify='undef'"
5143$ WC "d_fpclassl='undef'"
570bb66e
JH
5144$ WC "d_fpos64_t='" + d_fpos64_t + "'"
5145$ WC "d_frexpl='" + d_frexpl + "'"
5146$ WC "d_fs_data_s='undef'"
5147$ WC "d_fseeko='undef'"
5148$ WC "d_fsetpos='define'"
5149$ WC "d_fstatfs='undef'"
5150$ WC "d_fstatvfs='undef'"
411ab01c 5151$ WC "d_fsync='undef'"
570bb66e 5152$ WC "d_ftello='undef'"
fea629d8 5153$ WC "d_getcwd='define'"
570bb66e
JH
5154$ WC "d_getespwnam='undef'"
5155$ WC "d_getfsstat='undef'"
5156$ WC "d_getgrent='define'"
5157$ WC "d_getgrps='undef'"
5158$ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
5159$ WC "d_gethbyname='" + d_gethbyname + "'"
5160$ WC "d_gethent='" + d_gethent + "'"
5161$ WC "d_gethname='" + d_gethname + "'"
5162$ WC "d_gethostprotos='" + d_gethostprotos + "'"
10eefe7f 5163$ WC "d_getitimer='" + d_getitimer + "'"
570bb66e
JH
5164$ WC "d_getlogin='define'"
5165$ WC "d_getmnt='undef'"
5166$ WC "d_getmntent='undef'"
5167$ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
5168$ WC "d_getnbyname='" + d_getnbyname + "'"
5169$ WC "d_getnent='" + d_getnent + "'"
5170$ WC "d_getnetprotos='" + d_getnetprotos + "'"
0c0643d0 5171$ WC "d_getpagsz='undef'"
570bb66e
JH
5172$ WC "d_getpbyname='" + d_getpbyname + "'"
5173$ WC "d_getpbynumber='" + d_getpbynumber + "'"
5174$ WC "d_getpent='" + d_getpent + "'"
5175$ WC "d_getpgid='undef'"
5176$ WC "d_getpgrp2='undef'"
5177$ WC "d_getpgrp='undef'"
5178$ WC "d_getppid='undef'"
5179$ WC "d_getprior='undef'"
5180$ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
5181$ WC "d_getprpwnam='undef'"
5182$ WC "d_getpwent='define'"
5183$ WC "d_getsbyname='" + d_getsbyname + "'"
5184$ WC "d_getsbyport='" + d_getsbyport + "'"
5185$ WC "d_getsent='" + d_getsent + "'"
5186$ WC "d_getservprotos='" + d_getservprotos + "'"
5187$ WC "d_getspnam='undef'"
5188$ WC "d_gettimeod='" + d_gettimeod + "'"
5189$ WC "d_gnulibc='undef'"
5190$ WC "d_grpasswd='undef'"
5191$ WC "d_hasmntopt='undef'"
5192$ WC "d_htonl='" + d_htonl + "'"
570bb66e
JH
5193$ WC "d_index='" + d_index + "'"
5194$ WC "d_inetaton='undef'"
5195$ WC "d_int64_t='" + d_int64_t + "'"
5196$ WC "d_isascii='define'"
758a5d79
JH
5197$ WC "d_isfinite='undef'"
5198$ WC "d_isinf='undef'"
3a491987 5199$ WC "d_isnan='" + d_isnan + "'"
570bb66e
JH
5200$ WC "d_isnanl='" + d_isnanl + "'"
5201$ WC "d_killpg='undef'"
5202$ WC "d_lchown='undef'"
5203$ WC "d_ldbl_dig='define'"
5204$ WC "d_link='undef'"
5205$ WC "d_llseek='undef'"
5206$ WC "d_locconv='" + d_locconv + "'"
5207$ WC "d_lockf='undef'"
5208$ WC "d_longdbl='" + d_longdbl + "'"
5209$ WC "d_longlong='" + d_longlong + "'"
5210$ WC "d_lseekproto='define'"
5211$ WC "d_lstat='undef'"
5212$ WC "d_madvise='undef'"
5213$ WC "d_mblen='" + d_mblen + "'"
5214$ WC "d_mbstowcs='" + d_mbstowcs + "'"
5215$ WC "d_mbtowc='" + d_mbtowc + "'"
5216$ WC "d_memchr='" + d_memchr + "'"
5217$ WC "d_memcmp='define'"
5218$ WC "d_memcpy='define'"
5219$ WC "d_memmove='define'"
5220$ WC "d_memset='define'"
5221$ WC "d_mkdir='define'"
5222$ WC "d_mkdtemp='" + d_mkdtemp + "'"
5223$ WC "d_mkfifo='undef'"
5224$ WC "d_mknod='undef'"
5225$ WC "d_mkstemp='" + d_mkstemp + "'"
5226$ WC "d_mkstemps='" + d_mkstemps + "'"
5227$ WC "d_mktime='" + d_mktime + "'"
10eefe7f 5228$ WC "d_mmap='" + d_mmap + "'"
570bb66e 5229$ WC "d_modfl='" + d_modfl + "'"
7b826da8 5230$ WC "d_modfl_pow32_bug='undef'"
10eefe7f 5231$ WC "d_mprotect='" + d_mprotect + "'"
570bb66e
JH
5232$ WC "d_msg='undef'"
5233$ WC "d_msg_ctrunc='undef'"
5234$ WC "d_msg_dontroute='undef'"
5235$ WC "d_msg_oob='undef'"
5236$ WC "d_msg_peek='undef'"
5237$ WC "d_msg_proxy='undef'"
5238$ WC "d_msghdr_s='undef'"
10eefe7f
CB
5239$ WC "d_msync='" + d_msync + "'"
5240$ WC "d_munmap='" + d_munmap + "'"
570bb66e
JH
5241$ WC "d_mymalloc='" + d_mymalloc + "'"
5242$ WC "d_nice='define'"
2765b840 5243$ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
570bb66e
JH
5244$ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
5245$ WC "d_nv_preserves_uv_bits='" + d_nv_preserves_uv_bits + "'"
5246$ WC "d_off64_t='" + d_off64_t + "'"
5247$ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
5248$ WC "d_oldarchlib='define'"
5249$ WC "d_oldpthreads='" + d_oldpthreads + "'"
5250$ WC "d_open3='define'"
5251$ WC "d_pathconf='" + d_pathconf + "'"
5252$ WC "d_pause='define'"
5253$ WC "d_perl_otherlibdirs='undef'"
414b89cc 5254$ WC "d_phostname='" + d_phostname + "'"
570bb66e
JH
5255$ WC "d_pipe='define'"
5256$ WC "d_poll='undef'"
e9a8643a 5257$ WC "d_procselfexe='undef'"
d6483fcc 5258$ WC "d_pthread_atfork='undef'"
570bb66e
JH
5259$ WC "d_pthread_yield='" + d_pthread_yield + "'"
5260$ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
5261$ WC "d_pwage='undef'"
5262$ WC "d_pwchange='undef'"
5263$ WC "d_pwclass='undef'"
5264$ WC "d_pwcomment='define'"
5265$ WC "d_pwexpire='undef'"
5266$ WC "d_pwgecos='define'"
5267$ WC "d_pwpasswd='define'"
5268$ WC "d_pwquota='undef'"
5269$ WC "d_qgcvt='undef'"
5270$ WC "d_quad='" + d_quad + "'"
5271$ WC "d_readdir='define'"
5272$ WC "d_readlink='undef'"
5273$ WC "d_readv='undef'"
f42f5b4c 5274$ WC "d_realpath='undef'"
570bb66e
JH
5275$ WC "d_recvmsg='undef'"
5276$ WC "d_rename='define'"
5277$ WC "d_rewinddir='define'"
5278$ WC "d_rmdir='define'"
5279$ WC "d_safebcpy='undef'"
5280$ WC "d_safemcpy='define'"
5281$ WC "d_sanemcmp='define'"
414b89cc 5282$ WC "d_sbrkproto='define'"
570bb66e
JH
5283$ WC "d_sched_yield='" + d_sched_yield + "'"
5284$ WC "d_scm_rights='undef'"
5285$ WC "d_seekdir='define'"
5286$ WC "d_select='" + d_select + "'"
5287$ WC "d_sem='undef'"
5288$ WC "d_semctl_semid_ds='undef'"
5289$ WC "d_semctl_semun='undef'"
5290$ WC "d_sendmsg='undef'"
5291$ WC "d_setegid='undef'"
5292$ WC "d_setenv='" + d_setenv + "'"
5293$ WC "d_seteuid='undef'"
5294$ WC "d_setgrent='undef'"
5295$ WC "d_setgrps='undef'"
5296$ WC "d_sethent='" + d_sethent + "'"
10eefe7f 5297$ WC "d_setitimer='" + d_setitimer + "'"
570bb66e
JH
5298$ WC "d_setlinebuf='undef'"
5299$ WC "d_setlocale='" + d_setlocale + "'"
5300$ WC "d_setnent='" + d_setnent + "'"
5301$ WC "d_setpent='" + d_setpent + "'"
5302$ WC "d_setpgid='undef'"
5303$ WC "d_setpgrp2='undef'"
5304$ WC "d_setpgrp='undef'"
5305$ WC "d_setprior='undef'"
5306$ WC "d_setproctitle='" + d_setproctitle + "'"
5307$ WC "d_setpwent='define'"
5308$ WC "d_setregid='undef'"
5309$ WC "d_setresgid='undef'"
5310$ WC "d_setresuid='undef'"
5311$ WC "d_setreuid='undef'"
5312$ WC "d_setrgid='undef'"
5313$ WC "d_setruid='undef'"
5314$ WC "d_setsent='" + d_setsent + "'"
5315$ WC "d_setsid='undef'"
5316$ WC "d_setvbuf='" + d_setvbuf + "'"
5317$ WC "d_sfio='undef'"
5318$ WC "d_shm='undef'"
5319$ WC "d_shmatprototype='undef'"
5320$ WC "d_sigaction='" + d_sigaction + "'"
983dbef6 5321$ WC "d_sigprocmask='" + d_sigprocmask + "'"
570bb66e 5322$ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
49a78c82 5323$ WC "d_sockatmark='undef'"
2ef53570 5324$ WC "d_sockatmarkproto='undef'"
570bb66e
JH
5325$ WC "d_socket='" + d_socket + "'"
5326$ WC "d_socklen_t='" + d_socklen_t + "'"
5327$ WC "d_sockpair='undef'"
1b9c9cf5 5328$ WC "d_socks5_init='undef'"
570bb66e 5329$ WC "d_sqrtl='define'"
eef837ea 5330$ WC "d_sresgproto='undef'"
2ef53570
JH
5331$ WC "d_sresgproto='undef'"
5332$ WC "d_sresproto='undef'"
f42f5b4c 5333$ WC "d_sresuproto='undef'"
570bb66e
JH
5334$ WC "d_statblks='undef'"
5335$ WC "d_statfs_f_flags='undef'"
5336$ WC "d_statfs_s='undef'"
5337$ WC "d_statfsflags='undef'"
5338$ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
5339$ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
a7ffa9b9 5340$ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'"
2ef53570 5341$ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'"
570bb66e
JH
5342$ WC "d_stdio_stream_array='undef'"
5343$ WC "d_stdiobase='" + d_stdiobase + "'"
5344$ WC "d_stdstdio='" + d_stdstdio + "'"
5345$ WC "d_strchr='define'"
5346$ WC "d_strcoll='" + d_strcoll + "'"
5347$ WC "d_strctcpy='define'"
5348$ WC "d_strerrm='strerror((e),vaxc$errno)'"
5349$ WC "d_strerror='define'"
b3c85772 5350$ WC "d_strftime='define'"
570bb66e
JH
5351$ WC "d_strtod='define'"
5352$ WC "d_strtol='define'"
5353$ WC "d_strtold='" + d_strtold + "'"
5354$ WC "d_strtoll='" + d_strtoll + "'"
d0e6d399 5355$ WC "d_strtoq='define'"
570bb66e
JH
5356$ WC "d_strtoul='define'"
5357$ WC "d_strtoull='" + d_strtoull + "'"
5358$ WC "d_strtouq='" + d_strtouq + "'"
5359$ WC "d_strxfrm='" + d_strxfrm + "'"
5360$ WC "d_suidsafe='undef'"
5361$ WC "d_symlink='undef'"
5362$ WC "d_syscall='undef'"
2ef53570 5363$ WC "d_syscallproto='undef'"
570bb66e
JH
5364$ WC "d_sysconf='" + d_sysconf + "'"
5365$ WC "d_syserrlst='undef'"
5366$ WC "d_system='define'"
5367$ WC "d_tcgetpgrp='undef'"
5368$ WC "d_tcsetpgrp='undef'"
5369$ WC "d_telldir='define'"
5370$ WC "d_telldirproto='define'"
5371$ WC "d_times='define'"
5372$ WC "d_truncate='" + d_truncate + "'"
a3bd614a 5373$ WC "d_tzname='" + d_tzname + "'"
4e0554ec 5374$ WC "d_u32align='define'"
10eefe7f 5375$ WC "d_ualarm='" + d_ualarm + "'"
570bb66e
JH
5376$ WC "d_umask='define'"
5377$ WC "d_uname='" + d_uname + "'"
5378$ WC "d_union_semun='undef'"
5379$ WC "d_unlink_all_versions='undef'"
758a5d79 5380$ WC "d_unordered='undef'"
10eefe7f
CB
5381$ WC "d_usleep='" + d_usleep + "'"
5382$ WC "d_usleepproto='" + d_usleep + "'"
570bb66e
JH
5383$ WC "d_ustat='undef'"
5384$ WC "d_vendorarch='undef'"
5385$ WC "d_vendorlib='undef'"
5386$ WC "d_vfork='define'"
5387$ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
5388$ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
5389$ WC "d_void_closedir='define'"
5390$ WC "d_volatile='define'"
5391$ WC "d_vprintf='define'"
5392$ WC "d_wait4='" + d_wait4 + "'"
5393$ WC "d_waitpid='define'"
5394$ WC "d_wcstombs='" + d_wcstombs + "'"
5395$ WC "d_wctomb='" + d_wctomb + "'"
5396$ WC "d_writev='undef'"
5397$ WC "db_hashtype=' '"
5398$ WC "db_prefixtype=' '"
5399$ WC "dbgprefix='" + dbgprefix + "'"
5400$ WC "defvoidused='15'"
5401$ WC "devtype='" + devtype + "'"
5402$ WC "direntrytype='struct dirent'"
5403$ WC "dlext='" + dlext + "'"
5404$ WC "dlobj='" + dlobj + "'"
5405$ WC "dlsrc='dl_vms.c'"
5406$ WC "doublesize='" + doublesize + "'"
5407$ WC "drand01='" + drand01 + "'"
a3bd614a
PP
5408$!
5409$! The extensions symbol may be quite long
5410$!
5411$ tmp = "dynamic_ext='" + extensions + "'"
5412$ WC/symbol tmp
5413$ DELETE/SYMBOL tmp
570bb66e
JH
5414$ WC "eagain=' '"
5415$ WC "ebcdic='undef'"
9b5c8979 5416$ WC "embedmymalloc='" + usemymalloc + "'"
570bb66e
JH
5417$ WC "eunicefix=':'"
5418$ WC "exe_ext='" + exe_ext + "'"
a3bd614a
PP
5419$!
5420$! The extensions symbol may be quite long
5421$!
5422$ tmp = "extensions='" + extensions + "'"
5423$ WC/symbol tmp
5424$ DELETE/SYMBOL tmp
570bb66e
JH
5425$ WC "fflushNULL='define'"
5426$ WC "fflushall='undef'"
5427$ WC "fpostype='fpos_t'"
5428$ WC "freetype='void'"
5429$ WC "full_ar='" + "'"
5430$ WC "full_csh='" + " '"
5431$ WC "full_sed='_NLA0:'"
5432$ WC "gccversion='" + gccversion + "'"
5433$ WC "gidformat='lu'"
5434$ WC "gidsign='1'"
5435$ WC "gidsize='4'"
5436$ WC "gidtype='" + gidtype + "'"
5437$ WC "groupstype='Gid_t'"
5438$ WC "hint='none'"
5439$ WC "hintfile='" + "'"
5440$ WC "i16size='" + i16size + "'"
5441$ WC "i16type='" + i16type + "'"
5442$ WC "i32size='" + i32size + "'"
5443$ WC "i32type='" + i32type + "'"
5444$ WC "i64size='" + i64size + "'"
5445$ WC "i64type='" + i64type + "'"
5446$ WC "i8size='" + i8size + "'"
5447$ WC "i8type='" + i8type + "'"
5448$ WC "i_arpainet='undef'"
5449$ WC "i_dbm='undef'"
7558ebc2 5450$ WC "i_dirent='" + i_dirent + "'"
570bb66e
JH
5451$ WC "i_dlfcn='undef'"
5452$ WC "i_fcntl='" + i_fcntl + "'"
5453$ WC "i_float='define'"
758a5d79
JH
5454$ WC "i_fp='undef'"
5455$ WC "i_fp_class='undef'"
570bb66e 5456$ WC "i_grp='undef'"
570bb66e
JH
5457$ WC "i_ieeefp='undef'"
5458$ WC "i_inttypes='" + i_inttypes + "'"
2765b840 5459$ WC "i_langinfo='" + i_langinfo + "'"
570bb66e
JH
5460$ WC "i_libutil='" + i_libutil + "'"
5461$ WC "i_limits='define'"
5462$ WC "i_locale='" + i_locale + "'"
5463$ WC "i_machcthr='undef'"
5464$ WC "i_machcthreads='undef'"
5465$ WC "i_math='define'"
5466$ WC "i_memory='undef'"
5467$ WC "i_mntent='undef'"
5468$ WC "i_ndbm='undef'"
5469$ WC "i_netdb='" + i_netdb + "'"
5470$ WC "i_neterrno='define'"
5471$ WC "i_netinettcp='" + i_netinettcp + "'"
5472$ WC "i_niin='" + i_niin + "'"
5473$ WC "i_poll='" + i_poll + "'"
5474$ WC "i_prot='undef'"
5475$ WC "i_pthread='define'"
5476$ WC "i_pwd='undef'"
5477$ WC "i_rpcsvcdbm='undef'"
5478$ WC "i_sfio='undef'"
5479$ WC "i_sgtty='undef'"
5480$ WC "i_shadow='" + i_shadow + "'"
5481$ WC "i_socks='" + i_socks + "'"
5482$ WC "i_stdarg='define'"
5483$ WC "i_stddef='define'"
5484$ WC "i_stdlib='define'"
5485$ WC "i_string='define'"
5486$ WC "i_sunmath='undef'"
5487$ WC "i_sysaccess='" + i_sysaccess + "'"
5488$ WC "i_sysdir='undef'"
5489$ WC "i_sysfile='" + i_sysfile + "'"
5490$ WC "i_sysioctl='undef'"
5491$ WC "i_syslog='" + i_syslog + "'"
5492$ WC "i_sysmman='undef'"
5493$ WC "i_sysmode='" + i_sysmode + "'"
5494$ WC "i_sysmount='undef'"
5495$ WC "i_sysndir='undef'"
5496$ WC "i_sysparam='undef'"
5497$ WC "i_sysresrc='undef'"
5498$ WC "i_syssecrt='" + i_syssecrt + "'"
5499$ WC "i_sysselct='undef'"
49a78c82 5500$ WC "i_syssockio='undef'"
570bb66e
JH
5501$ WC "i_sysstat='define'"
5502$ WC "i_sysstatfs='undef'"
5503$ WC "i_sysstatvfs='undef'"
5504$ WC "i_systime='undef'"
5505$ WC "i_systimek='undef'"
5506$ WC "i_systimes='undef'"
5507$ WC "i_systypes='define'"
5508$ WC "i_sysuio='" + i_sysuio + "'"
5509$ WC "i_sysun='undef'"
5510$ WC "i_sysutsname='" + i_sysutsname + "'"
5511$ WC "i_sysvfs='undef'"
5512$ WC "i_syswait='undef'"
5513$ WC "i_termio='undef'"
5514$ WC "i_termios='undef'"
5515$ WC "i_time='define'"
5516$ WC "i_unistd='" + i_unistd + "'"
5517$ WC "i_ustat='undef'"
5518$ WC "i_utime='undef'"
5519$ WC "i_values='undef'"
5520$ WC "i_varargs='undef'"
5521$ WC "i_vfork='undef'"
5522$ WC "inc_version_list='0'"
5523$ WC "inc_version_list_init='0'"
5524$ WC "installarchlib='" + installarchlib + "'"
5525$ WC "installbin='" + installbin + "'"
5526$ WC "installman1dir='" + installman1dir + "'"
5527$ WC "installman3dir='" + installman3dir + "'"
5528$ WC "installprivlib='" + installprivlib + "'"
5529$ WC "installscript='" + installscript + "'"
5530$ WC "installsitearch='" + installsitearch + "'"
5531$ WC "installsitelib='" + installsitelib + "'"
5532$ WC "installusrbinperl='undef'"
5533$ WC "intsize='" + intsize + "'"
5534$ WC "ivdformat='" + ivdformat + "'"
5535$ WC "ivsize='" + ivsize + "'"
5536$ WC "ivtype='" + ivtype + "'"
a3bd614a
PP
5537$!
5538$! The known_extensions symbol may be quite long
5539$!
5540$ tmp = "known_extensions='" + known_extensions + "'"
5541$ WC/symbol tmp
5542$ DELETE/SYMBOL tmp
570bb66e
JH
5543$ WC "ld='" + ld + "'"
5544$ WC "lddlflags='/Share'"
f24fb74c 5545$ WC "ldflags='" + ldflags + "'"
570bb66e
JH
5546$ WC "lib_ext='" + lib_ext + "'"
5547$ WC "libc='" + libc + "'"
5548$ WC "libpth='/sys$share /sys$library'"
5549$ WC "libs='" + libs + "'"
5550$ WC "longdblsize='" + longdblsize + "'"
5551$ WC "longlongsize='" + longlongsize + "'"
5552$ WC "longsize='" + longsize + "'"
5553$ WC "lseeksize='4'"
5554$ WC "lseektype='int'"
5555$ WC "mab='" + "'"
5556$ WC "make='" + make + "'"
5557$ WC "malloctype='void *'"
5558$ WC "man1ext='rno'"
5559$ WC "man3ext='rno'"
10eefe7f 5560$ WC "mmaptype='void *'"
570bb66e
JH
5561$ WC "modetype='unsigned int'"
5562$ WC "multiarch='undef'"
5563$ WC "mydomain='" + mydomain + "'"
5564$ WC "myhostname='" + myhostname + "'"
5565$ WC "myuname='" + myuname + "'"
2cc61e15 5566$ WC "need_va_copy='undef'"
570bb66e
JH
5567$ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
5568$ WC "netdb_host_type='" + netdb_host_type + "'"
5569$ WC "netdb_name_type='" + netdb_name_type + "'"
5570$ WC "netdb_net_type='" + netdb_net_type + "'"
fd47df60
JH
5571$ WC "nveformat='" + nveformat + "'"
5572$ WC "nvfformat='" + nvfformat + "'"
5573$ WC "nvgformat='" + nvgformat + "'"
570bb66e
JH
5574$ WC "nvsize='" + nvsize + "'"
5575$ WC "nvtype='" + nvtype + "'"
5576$ WC "o_nonblock=' '"
5577$ WC "obj_ext='" + obj_ext + "'"
5578$ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
5579$ WC "oldarchlib='" + oldarchlib + "'"
5580$ WC "oldarchlibexp='" + oldarchlibexp + "'"
5581$ WC "optimize='" + optimize + "'"
5582$ WC "osname='" + osname + "'"
5583$ WC "osvers='" + osvers + "'"
5584$ WC "otherlibdirs='" + "'"
5585$ WC "package='" + package + "'"
5586$ WC "pager='" + pager + "'"
5587$ WC "patchlevel='" + patchlevel + "'"
5588$ WC "path_sep='|'"
5589$ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
5590$ WC "perladmin='" + perladmin + "'"
94928b12 5591$ WC "perllibs='" + perllibs + "'"
9b5c8979
JH
5592$ WC "perl_symbol='" + perl_symbol + "'" ! VMS specific
5593$ WC "perl_verb='" + perl_verb + "'" ! VMS specific
570bb66e
JH
5594$ WC "pgflquota='" + pgflquota + "'"
5595$ WC "pidtype='" + pidtype + "'"
5596$ WC "pm_apiversion='" + version + "'"
5597$! WC "prefix='" + vms_prefix + "'"
5598$ WC "prefix='" + prefix + "'"
5599$ WC "privlib='" + privlib + "'"
5600$ WC "privlibexp='" + privlibexp + "'"
357cef76 5601$ WC "procselfexe=' '"
570bb66e
JH
5602$ WC "prototype='define'"
5603$ WC "ptrsize='" + ptrsize + "'"
5604$ WC "quadkind='" + quadkind + "'"
5605$ WC "quadtype='" + quadtype + "'"
5606$ WC "randbits='31'"
5607$ WC "randseedtype='" + randseedtype + "'"
5608$ WC "ranlib='" + "'"
5609$ WC "rd_nodata=' '"
5610$ WC "revision='" + revision + "'"
570bb66e 5611$ WC "sPRId64='" + sPRId64 + "'"
6b356c8e
JH
5612$ WC "sPRIEldbl='" + sPRIEUldbl + "'"
5613$ WC "sPRIFldbl='" + sPRIFUldbl + "'"
5614$ WC "sPRIGldbl='" + sPRIGUldbl + "'"
5615$ WC "sPRIX64='" + sPRIXU64 + "'"
59a27e12 5616$ WC "sPRIeldbl='" + sPRIeldbl + "'"
570bb66e
JH
5617$ WC "sPRIfldbl='" + sPRIfldbl + "'"
5618$ WC "sPRIgldbl='" + sPRIgldbl + "'"
5619$! WC "sPRIi64='" + sPRIi64 + "'"
5620$ WC "sPRIo64='" + sPRIo64 + "'"
5621$ WC "sPRIu64='" + sPRIu64 + "'"
5622$ WC "sPRIx64='" + sPRIx64 + "'"
b5ddfb46 5623$ WC "sSCNfldbl='" + sSCNfldbl + "'"
570bb66e 5624$ WC "sched_yield='" + sched_yield + "'"
f688e3ac 5625$ WC "scriptdir='" + scriptdir + "'"
570bb66e
JH
5626$ WC "seedfunc='" + seedfunc + "'"
5627$ WC "selectminbits='32'"
5628$ WC "selecttype='" + selecttype + "'"
5629$ WC "sh='MCR'"
414b89cc 5630$ WC "shmattype='" + " '"
570bb66e
JH
5631$ WC "shortsize='" + shortsize + "'"
5632$ WC "shrplib='define'"
5633$ WC "sig_name='" + sig_name + "'"
5634$ tmp = "sig_name_init='" + sig_name_init + "'"
5635$ WC/symbol tmp
5636$ DELETE/SYMBOL tmp
5637$ WC "sig_num='" + sig_num + "'"
5638$ WC "sig_num_init='" + sig_num_init + "'"
76d3c696 5639$ WC "sig_size='" + sig_size + "'"
570bb66e
JH
5640$ WC "signal_t='" + signal_t + "'"
5641$ WC "sitearch='" + sitearch + "'"
5642$ WC "sitearchexp='" + sitearchexp + "'"
5643$ WC "sitelib='" + sitelib + "'"
5644$ WC "sitelib_stem='" + sitelib_stem + "'"
5645$ WC "sitelibexp='" + sitelibexp + "'"
5646$ WC "sizesize='" + sizesize + "'"
5647$ WC "sizetype='size_t'"
5648$ WC "so='" + so + "'"
5649$ WC "socksizetype='" + socksizetype + "'"
5650$ WC "spitshell='write sys$output '"
5651$ WC "src='" + src + "'"
5652$ WC "ssizetype='int'"
5653$ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
17e8697d 5654$ WC "static_ext='" + static_ext + "'"
570bb66e
JH
5655$ WC "stdchar='" + stdchar + "'"
5656$ WC "stdio_base='((*fp)->_base)'"
5657$ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
5658$ WC "stdio_cnt='((*fp)->_cnt)'"
5659$ WC "stdio_ptr='((*fp)->_ptr)'"
59a27e12 5660$ WC "stdio_stream_array=' " + "'"
570bb66e
JH
5661$ WC "subversion='" + subversion + "'"
5662$ WC "timetype='" + timetype + "'"
5663$ WC "u16size='" + u16size + "'"
5664$ WC "u16type='" + u16type + "'"
5665$ WC "u32size='" + u32size + "'"
5666$ WC "u32type='" + u32type + "'"
5667$ WC "u64size='" + u64size + "'"
5668$ WC "u64type='" + u64type + "'"
5669$ WC "u8size='" + u8size + "'"
5670$ WC "u8type='" + u8type + "'"
5671$ WC "uidformat='lu'"
5672$ WC "uidsign='1'"
5673$ WC "uidsize='4'"
5674$ WC "uidtype='" + uidtype + "'"
5675$ WC "uquadtype='" + uquadtype + "'"
5676$ WC "use5005threads='" + use5005threads + "'"
5677$ WC "use64bitall='" + use64bitall + "'"
5678$ WC "use64bitint='" + use64bitint + "'"
9b5c8979
JH
5679$ WC "usecasesensitive='" + be_case_sensitive + "'" ! VMS-specific
5680$ WC "usedebugging_perl='"+use_debugging_perl+"'"
5681$ WC "usedefaulttypes='" + usedefaulttypes + "'" ! VMS-specific
5440bc8e 5682$ WC "usecrosscompile='undef'"
570bb66e 5683$ WC "usedl='" + usedl + "'"
9b5c8979 5684$ WC "useieee='" + useieee + "'" ! VMS-specific
570bb66e
JH
5685$ WC "useithreads='" + useithreads + "'"
5686$ WC "uselargefiles='" + uselargefiles + "'"
5687$ WC "uselongdouble='" + uselongdouble + "'"
5688$ WC "usemorebits='" + usemorebits + "'"
5689$ WC "usemultiplicity='" + usemultiplicity + "'"
5690$ WC "usemymalloc='" + usemymalloc + "'"
c998f3c7 5691$ WC "useperlio='" + useperlio + "'"
570bb66e 5692$ WC "useposix='false'"
9514c62b 5693$ WC "usereentrant='undef'"
9b5c8979 5694$ WC "usesecurelog='" + usesecurelog + "'" ! VMS-specific
570bb66e
JH
5695$ WC "usesocks='undef'"
5696$ WC "usethreads='" + usethreads + "'"
5697$ WC "usevfork='true'"
9b5c8979 5698$ WC "usevmsdebug='" + usevmsdebug + "'" ! VMS-specific
570bb66e
JH
5699$ WC "uvoformat='" + uvoformat + "'"
5700$ WC "uvsize='" + uvsize + "'"
5701$ WC "uvtype='" + uvtype + "'"
5702$ WC "uvuformat='" + uvuformat + "'"
5703$ WC "uvxformat='" + uvxformat + "'"
414b89cc 5704$ WC "uvXUformat='" + uvXUformat + "'"
570bb66e
JH
5705$ WC "vendorarchexp='" + "'"
5706$ WC "vendorlib_stem='" + "'"
5707$ WC "vendorlibexp='" + "'"
5708$ WC "version='" + version + "'"
5709$ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
5710$ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
5711$ WC "vms_ver='" + vms_ver + "'" ! VMS specific
5712$ WC "voidflags='15'"
5713$ WC "xs_apiversion='" + version + "'"
a02608de 5714$ WC "PERL_CONFIG_SH='true'"
570bb66e
JH
5715$!
5716$! ##END WRITE NEW CONSTANTS HERE##
5717$!
5718$ CLOSE CONFIG
5719$!
5720$! Okay, we've gotten here. Build munchconfig.exe
5721$ COPY/NOLOG [-.vms]munchconfig.c []
7558ebc2 5722$ COPY/NOLOG [-.vms]'Makefile_SH' []
570bb66e
JH
5723$ 'Perl_CC' munchconfig.c
5724$ IF Needs_Opt
5725$ THEN
5726$ OPEN/WRITE CONFIG []munchconfig.opt
414b89cc 5727$ IF ccname .EQS. "GCC"
570bb66e
JH
5728$ THEN
5729$ WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
5730$ ENDIF
5731$ WRITE CONFIG "Sys$Share:VAXCRTL/Share"
5732$ CLOSE CONFIG
5733$ 'ld' munchconfig.obj,munchconfig.opt/opt
5734$ DELETE/NOLOG/NOCONFIRM munchconfig.opt;
5735$ ELSE
5736$ 'ld' munchconfig.obj
5737$ ENDIF
5738$ IF F$SEARCH("munchconfig.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.obj;
5739$ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
414b89cc 5740$ IF ccname .EQS. "CXX"
570bb66e
JH
5741$ THEN
5742$ CALL Cxx_demangler_cleanup
5743$ ENDIF
5744$!
5745$ IF alldone .EQS. ""
5746$ THEN
5747$ cat4 SYS$INPUT:
7558ebc2 5748$ DECK
570bb66e
JH
5749
5750If you'd like to make any changes to the config.sh file before I begin
5751to configure things, answer yes to the following question.
5752
7558ebc2 5753$ EOD
9b5c8979
JH
5754$ bool_dflt="n"
5755$ rp="Do you wish to edit ''basename_config_sh'? [''bool_dflt'] "
570bb66e 5756$ GOSUB myread
570bb66e
JH
5757$ IF ans
5758$ THEN
5759$ echo4 ""
5760$ echo4 "Be sure to type LOGOUT after you have edited the file,"
5761$ echo4 "then this procedure will resume."
5762$ echo4 ""
5763$ default = F$ENVIRONMENT("DEFAULT")
7558ebc2 5764$ DIRECTORY 'config_sh'
570bb66e
JH
5765$ SET DEFAULT [-]
5766$ SPAWN/WAIT
7558ebc2 5767$ SET DEFAULT 'default'
570bb66e
JH
5768$ ENDIF
5769$ ENDIF
5770$!
5771$ echo ""
5772$ echo4 "Adding ''osname' specific preprocessor commands."
5773$ !
5774$ ! we need an fdl file
5775$ CREATE [-]CONFIG.FDL
7558ebc2 5776$ DECK
570bb66e
JH
5777RECORD
5778 FORMAT STREAM_LF
7558ebc2 5779$ EOD
570bb66e
JH
5780$ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
5781$ ! First spit out the header info with the local defines (to get
5782$ ! around the 255 character command line limit)
5783$ OPEN/APPEND CONFIG [-]config.local
5784$ IF use_debugging_perl THEN WC "#define DEBUGGING"
5785$ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
5786$ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
5787$ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
5788$ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
414b89cc 5789$ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
570bb66e
JH
5790$ IF (Has_Dec_C_Sockets)
5791$ THEN
5792$ WC "#define VMS_DO_SOCKETS"
5793$ WC "#define DECCRTL_SOCKETS"
5794$ ELSE
5795$ IF Has_Socketshr THEN WC "#define VMS_DO_SOCKETS"
5796$ ENDIF
5797$! This is VMS-specific for now
5798$ WC "#''d_setenv' HAS_SETENV"
5799$ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
5800$ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
5801$ IF use64bitint .OR. use64bitint .EQS. "define"
5802$ THEN
5803$ WC "#define USE_64_BIT_INT"
5804$ WC "#define USE_LONG_DOUBLE"
5805$ ENDIF
5806$ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
5807 WC "#define USE_64_BIT_ALL"
5808$ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
5809$ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
5810$ WC "#define HAS_ENVGETENV"
5811$ WC "#define PERL_EXTERNAL_GLOB"
55315086
PP
5812$ IF archname .EQS. "VMS_VAX" .AND. -
5813 ccname .EQS. "DEC" .AND. -
5814 ccversion .LE. 50390006
5815$ THEN
5816$! Alas this does not help to build Fcntl
5817$! WC "#define PERL_IGNORE_FPUSIG SIGFPE"
5818$ ENDIF
f2610a60 5819$ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
570bb66e
JH
5820$ CLOSE CONFIG
5821$!
5822$ echo4 "Doing variable substitutions on .SH files..."
5823$ echo4 "Extracting config.h (with variable substitutions)"
5824$!
5825$! Now build the normal config.h
5826$ DEFINE/USER_MODE sys$output [-]config.main
7558ebc2 5827$ mcr []munchconfig 'config_sh' [-]config_h.sh
570bb66e
JH
5828$ ! Concatenate them together
5829$ copy [-]config.local,[-]config.main [-]config.h
5830$! Clean up
5831$ DELETE/NOLOG [-]CONFIG.MAIN;*
5832$ DELETE/NOLOG [-]CONFIG.LOCAL;*
5833$ DELETE/NOLOG [-]CONFIG.FDL;*
5834$!
414b89cc 5835$ IF ccname .EQS. "DEC"
570bb66e
JH
5836$ THEN
5837$ DECC_REPLACE = "DECC=decc=1"
5838$ ELSE
7558ebc2
PP
5839$ DECC_REPLACE = "DECC="
5840$ ENDIF
414b89cc 5841$ IF ccname .EQS. "CXX"
7558ebc2
PP
5842$ THEN
5843$ DECCXX_REPLACE = "DECCXX=DECCXX=1"
5844$ ELSE
5845$ DECCXX_REPLACE = "DECCXX="
570bb66e 5846$ ENDIF
414b89cc 5847$ IF ccname .EQS. "GCC"
570bb66e
JH
5848$ THEN
5849$ GNUC_REPLACE = "GNUC=gnuc=1"
5850$ ELSE
5851$ GNUC_REPLACE = "GNUC="
5852$ ENDIF
5853$ IF Has_Dec_C_Sockets
5854$ THEN
5855$ SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
5856$ ELSE
5857$ IF Has_Socketshr
5858$ THEN
5859$ SOCKET_REPLACE = "SOCKET=SOCKETSHR_SOCKETS=1"
5860$ ELSE
5861$ SOCKET_REPLACE = "SOCKET="
5862$ ENDIF
5863$ ENDIF
5864$ IF Use_Threads
5865$ THEN
5866$ IF (vms_ver .LES. "6.2")
5867$ THEN
5868$ THREAD_REPLACE = "THREAD=OLDTHREADED=1"
5869$ ELSE
5870$ THREAD_REPLACE = "THREAD=THREADED=1"
5871$ ENDIF
5872$ ELSE
5873$ THREAD_REPLACE = "THREAD="
5874$ ENDIF
5875$ IF mymalloc
5876$ THEN
5877$ MALLOC_REPLACE = "MALLOC=MALLOC=1"
5878$ ELSE
5879$ MALLOC_REPLACE = "MALLOC="
5880$ ENDIF
5881$ echo4 "Extracting ''defmakefile' (with variable substitutions)"
7558ebc2
PP
5882$ DEFINE/USER_MODE sys$output 'UUmakefile'
5883$ mcr []munchconfig 'config_sh' 'Makefile_SH' "''DECC_REPLACE'" -
5884 "''DECCXX_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" -
5885 "''THREAD_REPLACE'" "''C_Compiler_Replace'" "''MALLOC_REPLACE'" -
5886 "''Thread_Live_Dangerously'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'"
5887$! Clean up after ourselves
5888$ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
a3bd614a 5889$!
7558ebc2
PP
5890$ echo4 "Extracting make_ext.com (without variable substitutions)"
5891$ Create Sys$Disk:[-]make_ext.com
570bb66e 5892$ Deck/Dollar="$EndOfTpl$"
7558ebc2 5893$!++ make_ext.com
570bb66e
JH
5894$! NOTE: This file is extracted as part of the VMS configuration process.
5895$! Any changes made to it directly will be lost. If you need to make any
56aeb0ae 5896$! changes, please edit the template in Configure.Com instead.
570bb66e 5897$ def = F$Environment("Default")
a3bd614a
PP
5898$! p1 - how to invoke miniperl (passed in from descrip.mms)
5899$ p1 = F$Edit(p1,"Upcase,Compress,Trim")
5900$ If F$Locate("MCR ",p1).eq.0 Then p1 = F$Extract(3,255,p1)
5901$ miniperl = "$" + F$Search(F$Parse(p1,".Exe"))
5902$! p2 - how to invoke local make utility (passed in from descrip.mms)
5903$ makeutil = p2
5904$ if f$type('p2') .nes. "" then makeutil = 'p2'
5905$! p3 - make target (passed in from descrip.mms)
5906$ targ = F$Edit(p3,"Lowercase")
5907$ sts = 1
5908$ extensions = ""
5909$ open/read CONFIG config.sh
5910$ find_ext_loop:
5911$ read/end=end_ext_loop CONFIG line
5912$ if (f$extract(0,12,line) .NES. "extensions='")
5913$ then goto find_ext_loop
5914$ else extensions = f$extract(12,f$length(line),line) - "'"
5915$ endif
5916$ end_ext_loop:
5917$ close CONFIG
5918$ extensions = f$edit(extensions,"TRIM,COMPRESS")
570bb66e
JH
5919$ i = 0
5920$ next_ext:
a3bd614a
PP
5921$ ext = f$element(i," ",extensions)
5922$ If ext .eqs. " " .or. ext .eqs. "" Then Goto done
570bb66e
JH
5923$ Define/User_mode Perl_Env_Tables CLISYM_LOCAL
5924$ miniperl
7558ebc2 5925$ deck
570bb66e
JH
5926 ($extdir = $ENV{'ext'}) =~ s/::/./g;
5927 $extdir =~ s#/#.#g;
5928 if ($extdir =~ /^vms/i) { $extdir =~ s/vms/.vms.ext/i; }
5929 else { $extdir = ".ext.$extdir"; }
5930 ($ENV{'extdir'} = "[$extdir]");
5931 ($ENV{'up'} = ('-') x ($extdir =~ tr/././));
7558ebc2 5932$ eod
570bb66e
JH
5933$ Set Default &extdir
5934$ redesc = 0
5935$ If F$Locate("clean",targ) .eqs. F$Length(targ)
5936$ Then
7558ebc2
PP
5937$ Write Sys$Output ""
5938$ Write Sys$Output " Making ''ext' (dynamic)"
570bb66e
JH
5939$ On Error Then Goto done
5940$ If F$Search("Descrip.MMS") .eqs. ""
5941$ Then
5942$ redesc = 1
5943$ Else
5944$ If F$CvTime(F$File("Descrip.MMS","rdt")) .lts. -
5945 F$CvTime(F$File("Makefile.PL","rdt")) Then redesc = 1
5946$ EndIf
5947$ Else
5948$ Write Sys$Output "''targ'ing ''ext' . . ."
5949$ On Error Then Continue
5950$ EndIf
5951$ If redesc Then -
5952 miniperl "-I[''up'.lib]" Makefile.PL "INST_LIB=[''up'.lib]" "INST_ARCHLIB=[''up'.lib]"
5953$ makeutil 'targ'
5954$ i = i + 1
5955$ Set Def &def
5956$ Goto next_ext
5957$ done:
5958$ sts = $Status
5959$ Set Def &def
5960$ Exit sts
7558ebc2 5961$!-- make_ext.com
570bb66e
JH
5962$EndOfTpl$
5963$!
414b89cc
CB
5964$! Note that the /key qualifier to search, as in:
5965$! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
5966$! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
5967$!
5968$ echo4 "Extracting extra_pods.com (without variable substitutions)"
5969$ Create Sys$Disk:[-]extra_pods.com
5970$ Deck/Dollar="$EOExtra_Pods$"
5971$!++ extra_pods.com
5972$! NOTE: This file is extracted as part of the VMS configuration process.
5973$! Any changes made to it directly will be lost. If you need to make any
5974$! changes, please edit the template in Configure.Com instead.
5975$! Use FORCE if you've just podified a README.* file on VMS.
5976$ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
5977 search README.* "=head"/window=0/output=extra.pods
5978$ open/read/error=extra_close EXTRA extra.pods
5979$extra_loop:
5980$ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
5981$ file_type = f$parse(file,,,"TYPE",) - "."
5982$ if file_type .nes. "VMS" .and. file_type .nes. "vms"
5983$ then
5984$ pod_file = "[.pod]perl''file_type'.pod"
5985$ file = file - "''f$parse(file,,,"VERSION",)'"
5986$ if p1 .eqs. "CLEAN"
5987$ then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
5988$ else
5989$ do_copy := false
5990$ if f$search(pod_file) .eqs. ""
5991$ then do_copy := true
5992$ else
5993$ file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
5994$ pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
5995$ if file_rdt .GTS. pod_file_rdt then do_copy := true
5996$ endif
5997$ if do_copy then copy/log/noconfirm 'file' 'pod_file'
5998$ endif
5999$ endif
6000$ goto extra_loop
6001$extra_close:
6002$ close EXTRA
6003$ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
6004 purge/nolog extra.pods
6005$!-- extra_pods.com
6006$EOExtra_Pods$
97abc6ad 6007$!
146174a9 6008$! Warn of dangerous symbols or logical names
a4521476 6009$!
146174a9
CB
6010$Bad_environment: SUBROUTINE
6011$ Bad_env = ""
6012$ IF p2 .eqs. "SYMBOL"
6013$ THEN
7558ebc2 6014$ IF f$type('p1') .nes. "" THEN Bad_env := SYMBOL
146174a9
CB
6015$ ELSE
6016$ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
6017$ ENDIF
6018$ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
a4521476
PP
6019$ THEN
6020$ IF f$search("config.msg") .nes. ""
6021$ THEN
6022$ OPEN/APPEND CONFIG config.msg
6023$ ELSE
6024$ OPEN/WRITE CONFIG config.msg
6025$ ENDIF
146174a9
CB
6026$ IF Bad_env .eqs. "SYMBOL"
6027$ THEN
6028$ WRITE CONFIG ""
6029$ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
6030$ WRITE CONFIG " delete before building ''package' via:"
6031$ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
6032$ IF f$locate("""",&p1) .ge. f$length(&p1)
6033$ THEN
7558ebc2 6034$ WRITE CONFIG " after building, testing, and installing ''package'"
146174a9
CB
6035$ WRITE CONFIG " restore the symbol with:"
6036$ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
6037$ ENDIF
6038$ ENDIF
6039$ IF Bad_env .eqs. "LOGICAL"
6040$ THEN
6041$ WRITE CONFIG ""
6042$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
6043$ WRITE CONFIG " deassign before building ''package'"
6044$ ENDIF
a4521476 6045$ CLOSE CONFIG
146174a9 6046$ Bad_env = ""
a4521476
PP
6047$ ENDIF
6048$ EXIT
146174a9 6049$ ENDSUBROUTINE ! Bad_environment
a4521476 6050$ echo ""
570bb66e 6051$ echo4 "Checking for dangerous pre-existing global symbols and logical names."
146174a9
CB
6052$ CALL Bad_environment "TMP"
6053$ CALL Bad_environment "LIB"
6054$ CALL Bad_environment "T"
6055$ CALL Bad_environment "FOO"
6056$ CALL Bad_environment "EXT"
a3bd614a
PP
6057$ CALL Bad_environment "SOME_LOGICAL_NAME_NOT_LIKELY"
6058$ CALL Bad_environment "DOWN_LOGICAL_NAME_NOT_LIKELY"
146174a9 6059$ CALL Bad_environment "TEST" "SYMBOL"
a4521476
PP
6060$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
6061$!
97abc6ad
HM
6062$! %Config-I-VMS, write perl_setup.com here
6063$!
86fced14
CB
6064$ IF (.NOT.perl_symbol)
6065$ THEN
6066$ file_2_find = "[-]''packageup'.cld"
6067$ echo ""
570bb66e 6068$ echo4 "The perl.cld file is now being written..."
86fced14 6069$ OPEN/WRITE CONFIG 'file_2_find'
c645ec3f 6070$ ext = ".exe"
55315086 6071$ IF (sharedperl .AND. archname .EQS. "VMS_AXP") THEN ext := .AXE
86fced14
CB
6072$ IF (use_vmsdebug_perl)
6073$ THEN
6074$ WRITE CONFIG "define verb dbgperl"
570bb66e 6075$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
86fced14
CB
6076$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6077$ WRITE CONFIG ""
6078$ WRITE CONFIG "define verb perl"
570bb66e 6079$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
86fced14
CB
6080$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6081$ ELSE
6082$ WRITE CONFIG "define verb perl"
570bb66e 6083$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
86fced14
CB
6084$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6085$ ENDIF
6086$ CLOSE CONFIG
6087$ ENDIF ! (.NOT.perl_symbol)
97abc6ad 6088$ echo ""
570bb66e 6089$ echo4 "The perl_setup.com file is now being written..."
a3ef2c6f 6090$ file_2_find = "[-]perl_setup.com"
97abc6ad
HM
6091$ OPEN/WRITE CONFIG 'file_2_find'
6092$ WRITE CONFIG "$!"
6093$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
6094$ IF cf_email.NES.perladmin
6095$ THEN
6096$ WRITE CONFIG "$! perl configured by ''cf_email'"
6097$ ELSE
6098$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
6099$ ENDIF
6100$ WRITE CONFIG "$!"
3eeba6fb 6101$ prefix = prefix - "000000."
97abc6ad
HM
6102$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
6103 prefix = prefix - "]" + ".]"
570bb66e 6104$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
86fced14 6105$ WRITE CONFIG "$ ext = "".exe"""
570bb66e 6106$ IF sharedperl
86fced14 6107$ THEN
570bb66e 6108$ write config "$ if f$getsyi(""HW_MODEL"") .ge. 1024 then ext = "".AXE"""
86fced14
CB
6109$ ENDIF
6110$ IF (perl_symbol)
6111$ THEN
6112$ IF (use_vmsdebug_perl)
6113$ THEN
570bb66e
JH
6114$ WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgPerl'ext'"
6115$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]ndbgPerl'ext'"
6116$ WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
86fced14 6117$ ELSE
570bb66e
JH
6118$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
6119$ WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
86fced14
CB
6120$ ENDIF
6121$ ELSE ! .NOT.perl_symbol
6122$ IF (use_vmsdebug_perl)
6123$ THEN
570bb66e 6124$ WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
86fced14 6125$ ELSE
570bb66e 6126$ WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
86fced14
CB
6127$ ENDIF
6128$ IF perl_verb .EQS. "PROCESS"
6129$ THEN
570bb66e 6130$ WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
86fced14
CB
6131$ ENDIF
6132$ ENDIF ! perl_symbol
570bb66e
JH
6133$ WRITE CONFIG "$ define/nolog pod2text ''vms_prefix':[lib.pod]pod2text.com"
6134$ WRITE CONFIG "$ define/nolog pod2html ''vms_prefix':[lib.pod]pod2html.com"
6135$ WRITE CONFIG "$ define/nolog pod2man ''vms_prefix':[lib.pod]pod2man.com"
3eeba6fb 6136$!
97abc6ad
HM
6137$ IF (tzneedset)
6138$ THEN
6139$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6140$ ELSE !leave in but commented out (in case setting was from perl :-)
6141$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6142$ ENDIF
6143$ WRITE CONFIG "$!"
dab31494 6144$ WRITE CONFIG "$! Symbols for commonly used programs:"
97abc6ad 6145$ WRITE CONFIG "$!"
86fced14
CB
6146$ IF (perl_symbol)
6147$ THEN
570bb66e 6148$ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' ''vms_prefix':[lib.pod]Perldoc.com -t"""
86fced14
CB
6149$ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
6150$ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
570bb66e 6151$ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' ''vms_prefix':[lib.pod]pod2latex.com"""
86fced14 6152$ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
570bb66e
JH
6153$ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' ''vms_prefix':[lib]Perlbug.com"""
6154$ WRITE CONFIG "$ c2ph == ""'"+"'Perl' ''vms_prefix':[utils]c2ph.com"""
86fced14
CB
6155$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6156$ THEN
570bb66e 6157$ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' ''vms_prefix':[utils]dprofpp.com"""
86fced14 6158$ ENDIF
570bb66e
JH
6159$ WRITE CONFIG "$ h2ph == ""'"+"'Perl' ''vms_prefix':[utils]h2ph.com"""
6160$ WRITE CONFIG "$ h2xs == ""'"+"'Perl' ''vms_prefix':[utils]h2xs.com"""
6161$ WRITE CONFIG "$!perlcc == ""'"+"'Perl' ''vms_prefix':[utils]perlcc.com"""
dab31494 6162$ WRITE CONFIG "$ perlivp == ""'"+"'Perl' ''vms_prefix':[utils]perlivp.com"""
570bb66e 6163$ WRITE CONFIG "$ splain == ""'"+"'Perl' ''vms_prefix':[utils]splain.com"""
86fced14 6164$ ELSE
570bb66e 6165$ WRITE CONFIG "$ Perldoc == ""Perl ''vms_prefix':[lib.pod]Perldoc.com -t"""
86fced14
CB
6166$ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
6167$ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
570bb66e 6168$ WRITE CONFIG "$ pod2latex == ""Perl ''vms_prefix':[lib.pod]pod2latex.com"""
86fced14 6169$ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
570bb66e
JH
6170$ WRITE CONFIG "$!Perlbug == ""Perl ''vms_prefix':[lib]Perlbug.com"""
6171$ WRITE CONFIG "$ c2ph == ""Perl ''vms_prefix':[utils]c2ph.com"""
86fced14
CB
6172$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6173$ THEN
570bb66e 6174$ WRITE CONFIG "$ dprofpp == ""Perl ''vms_prefix':[utils]dprofpp.com"""
86fced14 6175$ ENDIF
570bb66e
JH
6176$ WRITE CONFIG "$ h2ph == ""Perl ''vms_prefix':[utils]h2ph.com"""
6177$ WRITE CONFIG "$ h2xs == ""Perl ''vms_prefix':[utils]h2xs.com"""
6178$ WRITE CONFIG "$!perlcc == ""Perl ''vms_prefix':[utils]perlcc.com"""
dab31494 6179$ WRITE CONFIG "$ perlivp == ""Perl ''vms_prefix':[utils]perlivp.com"""
570bb66e 6180$ WRITE CONFIG "$ splain == ""Perl ''vms_prefix':[utils]splain.com"""
86fced14 6181$ ENDIF
97abc6ad
HM
6182$ CLOSE CONFIG
6183$!
6184$ echo ""
570bb66e
JH
6185$ echo "The file can be found at:"
6186$ echo4 " ''F$SEARCH(file_2_find)'"
6187$ echo "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
6188$ echo "when you are satisfied with a successful compilation,"
6189$ echo "testing, and installation of your perl."
97abc6ad 6190$ echo ""
86fced14
CB
6191$ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
6192$ THEN
6193$ file_2_find = "[-]''packageup'_install.com"
7558ebc2 6194$ OPEN/WRITE CONFIG 'file_2_find'
86fced14
CB
6195$ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
6196$ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
6197$ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
6198$ CLOSE CONFIG
6199$ echo4 ""
570bb66e
JH
6200$ echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
6201$ echo4 " @ ''F$SEARCH(file_2_find)'"
6202$ echo4 "after a successful build, test, and install. Do so with CMKRNL privilege."
86fced14
CB
6203$ echo4 ""
6204$ ENDIF
97abc6ad
HM
6205$!
6206$!figure out where we "are" by parsing 'vms_default_directory_name'
6207$!
6208$ set_def_command = ""
6209$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
6210$ tmp = vms_default_directory_name - dflt - "]"
6211$ i = 0
6212$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
6213$Set_def_loop:
6214$ tmp1 = F$ELEMENT(i,".",tmp)
6215$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
6216$ IF i .EQ. 0
6217$ THEN set_def_command = "set default [-"
6218$ ELSE set_def_command = set_def_command + "-"
6219$ ENDIF
6220$ i = i + 1
6221$ GOTO Set_def_loop
6222$Beyond_set_def_loop:
6223$ IF set_def_command.NES.""
6224$ THEN
6225$ set_def_command = set_def_command - "-" + "]"
6226$ echo4 ""
6227$ echo4 "In order to build ''package' you must now issue the commands:"
6228$ echo4 ""
6229$ echo4 " ''set_def_command'"
6230$ ELSE
6231$ echo4 ""
6232$ echo4 "In order to build ''package' you must now issue the command:"
6233$ echo4 ""
6234$ ENDIF
6235$ echo4 " ''make'''makefile'", macros
6236$ echo4 ""
6237$!
a4521476
PP
6238$ IF ( F$SEARCH("config.msg").NES."" )
6239$ THEN
6240$ echo "Hmm. I also noted the following information while running:"
6241$ echo ""
6242$ type config.msg
6243$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
6244$ DELETE/NOLOG/NOCONFIRM config.msg;
6245$ ENDIF
6246$!
97abc6ad
HM
6247$Clean_up:
6248$ IF (silent)
6249$ THEN
6250$ DEASSIGN SYS$OUTPUT
6251$! DEASSIGN SYS$ERROR
6252$ ENDIF
414b89cc
CB
6253$ IF F$GETJPI("","FILCNT").GT.vms_filcnt THEN CLOSE CONFIG
6254$ IF F$GETJPI("","FILCNT").GT.vms_filcnt
97abc6ad
HM
6255$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
6256$ ENDIF
6257$ dflt = F$ENVIRONMENT("DEFAULT")
6258$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
6259$ THEN
6260$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
6261$ SET DEFAULT [-]
6262$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
6263$ DELETE/NOLOG/NOCONFIRM UU.DIR;
6264$ ENDIF
6265$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
97abc6ad
HM
6266$ EXIT
6267$!: End of Configure