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