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