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