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