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