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