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