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