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