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