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