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