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