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