This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
installhtml: new location for imports of helper functions
[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
1873if necessary. Currently, the "perlbug" program included with perl
98393d94 1874will send mail to this address in addition to perlbug@perl.org. You may
97abc6ad 1875enter "none" for no administrator.
7558ebc2 1876$ EOD
97abc6ad
HM
1877$ ENDIF
1878$ dflt = "''cf_email'"
1879$ rp = "Perl administrator e-mail address [''dflt'] "
1880$ GOSUB myread
9b5c8979 1881$ perladmin = ans
97abc6ad
HM
1882$!
1883$!: determine where public executable scripts go
1884$!: determine perl absolute location
1885$!: figure out how to guarantee perl startup
1886$!
1887$!: see how we invoke the C preprocessor
1888$! echo ""
1889$! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
1890$!: Set private lib path
1891$!: Now check and see which directories actually exist, avoiding duplicates
1892$!: determine optimize, if desired, or use for debug flag also
1893$!: We will not override a previous value, but we might want to
1894$!: augment a hint file
1895$!: the following weeds options from ccflags that are of no interest to cpp
1896$!: flags used in final linking phase
1897$!: Try to guess additional flags to pick up local libraries.
1898$!: coherency check
1899$! echo ""
1900$! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
1901$!: compute shared library extension
1902$!: Looking for optional libraries
1903$!: see if nm is to be used to determine whether a symbol is defined or not
1904$!: get list of predefined functions in a handy place
983dbef6 1905$!: see if we have sigaction or sigprocmask
fcc434ad 1906$ IF (ccname .EQS. "DEC" .AND. Dec_C_Version .GE. 50200000) .OR. (ccname .EQS. "CXX")
97abc6ad
HM
1907$ THEN
1908$ Has_Dec_C_Sockets = "T"
1909$ echo ""
7558ebc2 1910$ echo4 "Hmm... Looks like you have Dec C Berkeley networking support."
570bb66e
JH
1911$ ELSE
1912$ Has_Dec_C_Sockets = "F"
97abc6ad 1913$ ENDIF
046cc26c
CB
1914$!
1915$ IF Has_Dec_C_Sockets
97abc6ad
HM
1916$ THEN
1917$ echo ""
046cc26c
CB
1918$ echo "You have sockets available via the C library. Should socket support"
1919$ echo "be built into Perl?"
1920$ dflt = "DECC"
1921$ rp = "Choose socket support option (NONE"
570bb66e 1922$ IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
97abc6ad
HM
1923$ rp = rp + ") [''dflt'] "
1924$ GOSUB myread
570bb66e
JH
1925$ Has_Dec_C_Sockets = "F"
1926$ Has_socketshr = "F"
97abc6ad 1927$ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
fcc434ad 1928$ IF ans.eqs."decc" THEN Has_Dec_C_Sockets = "T"
570bb66e 1929$ ENDIF
97abc6ad
HM
1930$!
1931$!
3eeba6fb 1932$! Ask if they want to build with VMS_DEBUG perl
146174a9 1933$ echo ""
3eeba6fb
CB
1934$ echo "Perl can be built to run under the VMS debugger."
1935$ echo "You should only select this option if you are debugging"
1936$ echo "perl itself. This can be a useful feature if you are "
1937$ echo "embedding perl in a program."
9b5c8979
JH
1938$ bool_dflt = "n"
1939$ if f$type(usevmsdebug) .nes. ""
1940$ then
1941$ if usevmsdebug .or. usevmsdebug .eqs. "define" then bool_dflt="y"
1942$ endif
1943$ rp = "Build a VMS-DEBUG version of Perl? [''bool_dflt'] "
3eeba6fb 1944$ GOSUB myread
9b5c8979
JH
1945$ use_vmsdebug_perl = ans
1946$ IF use_vmsdebug_perl
3eeba6fb 1947$ THEN
9b5c8979 1948$ usevmsdebug = "define"
3eeba6fb 1949$ ELSE
9b5c8979 1950$ usevmsdebug = "undef"
3eeba6fb
CB
1951$ ENDIF
1952$!
8c99d73e
GS
1953$! Ask if they want to build with DEBUGGING
1954$ echo ""
7558ebc2
PP
1955$ echo "Perl can be built with extra runtime debugging enabled. This"
1956$ echo "enables the -D switch, at the cost of some performance. It"
1957$ echo "was mandatory on perl 5.005 and before on VMS, but is now"
1958$ echo "optional. If you do not generally use it you should probably"
1959$ echo "leave this off and gain a bit of extra speed."
6a0e5042
CB
1960$ bool_dflt = "n"
1961$ if f$type(DEBUGGING) .nes. ""
9b5c8979 1962$ then
6a0e5042 1963$ if f$extract(0,1,f$edit(DEBUGGING,"collapse,upcase")).eqs."Y" .or. DEBUGGING .eqs. "define" then bool_dflt="y"
9b5c8979
JH
1964$ endif
1965$ rp = "Build a DEBUGGING version of Perl? [''bool_dflt'] "
8c99d73e 1966$ GOSUB myread
9b5c8979 1967$ use_debugging_perl = ans
8c99d73e 1968$!
79e63f36 1969$!
97abc6ad 1970$! Ask about threads, if appropriate
414b89cc 1971$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
97abc6ad 1972$ THEN
146174a9 1973$ echo ""
0f7b1033 1974$ echo "Perl can be built to offer a form of threading support on some systems."
0e965207
JH
1975$ echo "To do so, configure.com can be run with -""Dusethreads""."
1976$ echo ""
1977$ echo "Note that Perl built with threading support runs slightly slower"
0f7b1033 1978$ echo "and uses slightly more memory than plain Perl."
0e965207 1979$ echo ""
9b5c8979
JH
1980$ bool_dflt = "n"
1981$ if f$type(usethreads) .nes. ""
1982$ then
1983$ if usethreads .or. usethreads .eqs. "define" then bool_dflt="y"
1984$ endif
0f7b1033 1985$! Catch cases where user specified ithreads but
0e965207
JH
1986$! forgot -Dusethreads
1987$ if f$type(useithreads) .nes. ""
1988$ then
1989$ if useithreads .or. useithreads .eqs. "define" then bool_dflt="y"
1990$ endif
0e965207
JH
1991$ echo "If this doesn't make any sense to you, just accept the default '" + bool_dflt + "'."
1992$ rp = "Build a threading Perl? [''bool_dflt'] "
97abc6ad 1993$ GOSUB myread
9b5c8979 1994$ if ans
97abc6ad 1995$ THEN
01aa1a42 1996$ usethreads = "define"
97abc6ad 1997$ use_threads="T"
0e965207 1998$ bool_dflt = "y"
9b5c8979
JH
1999$ if f$type(useithreads) .nes. ""
2000$ then
41cbbefa 2001$ if useithreads .eqs. "undef" then bool_dflt="n"
0e965207 2002$ endif
1c2e8cca 2003$ rp = "Use the newer interpreter-based ithreads? [''bool_dflt'] "
2974eb71 2004$ GOSUB myread
9b5c8979 2005$ use_ithreads=ans
3f39e13a
CB
2006$ ! Are they on VMS 7.1 or greater?
2007$ IF "''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.1"
429a5e67
DS
2008$ THEN
2009$ echo ""
3f39e13a
CB
2010$ echo "Threaded Perl can be linked to use system upcalls on your system. This feature"
2011$ echo "allows the thread scheduler to be made aware of system events (such as I/O)"
2012$ echo "so as to prevent a single thread from blocking all the threads in a program,"
2013$ echo "even on a single-processor machine."
2014$ bool_dflt = "y"
2015$ IF f$type(usethreadupcalls) .NES. ""
2016$ THEN
2017$ if .not. usethreadupcalls .or. usethreadupcalls .eqs. "undef" then bool_dflt="n"
2018$ ENDIF
2019$ rp = "Enable thread upcalls? [''bool_dflt'] "
429a5e67 2020$ gosub myread
3f39e13a 2021$ IF ans
429a5e67 2022$ THEN
3f39e13a
CB
2023$ thread_upcalls = "MTU=MTU=1"
2024$ usethreadupcalls = "define"
2025$ ! Are they on alpha or itanium?
054a3baf 2026$ IF ("''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.2")
3f39e13a
CB
2027$ THEN
2028$ echo ""
2029$ echo "Threaded Perl can be linked to use multiple kernel threads on your system."
db7bf729 2030$ echo "This feature allows multiple user threads to make use of multiple CPUs on"
3f39e13a
CB
2031$ echo "a multi-processor machine."
2032$ bool_dflt = "n"
2033$ IF f$type(usekernelthreads) .nes. ""
2034$ THEN
2035$ if usekernelthreads .or. usekernelthreads .eqs. "define" then bool_dflt="y"
2036$ ENDIF
2037$ rp = "Enable multiple kernel threads? [''bool_dflt'] "
2038$ gosub myread
2039$ IF ans
2040$ THEN
2041$ thread_kernel = "MTK=MTK=1"
2042$ usekernelthreads = "define"
db7bf729 2043$ ENDIF
3f39e13a 2044$ ENDIF
429a5e67
DS
2045$ ENDIF
2046$ ENDIF
01aa1a42
CB
2047$ ELSE
2048$ usethreads = "undef"
97abc6ad 2049$ ENDIF
96027ab8
CB
2050$ ELSE
2051$ usethreads = "undef"
97abc6ad 2052$ ENDIF
3f39e13a
CB
2053$ IF F$TYPE(usethreadupcalls) .EQS. "" THEN usethreadupcalls = "undef"
2054$ IF F$TYPE(usekernelthreads) .EQS. "" THEN usekernelthreads = "undef"
01aa1a42
CB
2055$!
2056$! Ask if they want to build with MULTIPLICITY
2057$ echo ""
2058$ echo "Perl can be built so that multiple Perl interpreters can coexist"
2059$ echo "within the same Perl executable."
2060$ IF usethreads .OR. usethreads .EQS. "define"
2061$ THEN
2062$ echo "This multiple interpreter support is required for interpreter-based threads."
2063$ usemultiplicity="define"
2064$ ELSE
2065$ bool_dflt = "n"
2066$ if f$type(usemultiplicity) .nes. ""
2067$ then
2068$ if usemultiplicity .or. usemultiplicity .eqs. "define" then bool_dflt = "y"
2069$ endif
2070$ rp = "Build Perl for multiplicity? [''bool_dflt'] "
2071$ GOSUB myread
2072$ IF ans
2073$ THEN
2074$ usemultiplicity="define"
2075$ ELSE
2076$ usemultiplicity="undef"
2077$ ENDIF
2078$ ENDIF
2079$!
2080$! Ask if they want to build with 64-bit support
054a3baf
CB
2081$ bool_dflt = "n"
2082$ IF F$TYPE(use64bitint) .NES. ""
01aa1a42 2083$ THEN
054a3baf
CB
2084$ IF use64bitint .OR. use64bitint .eqs. "define" THEN bool_dflt = "y"
2085$ ENDIF
2086$ echo ""
2087$ echo "You have natively 64-bit long integers."
2088$ echo ""
2089$ echo "Perl can be built to take advantage of 64-bit integer types"
2090$ echo "on some systems, To do so, Configure can be run with -Duse64bitint."
2091$ echo "Choosing this option will most probably introduce binary incompatibilities."
2092$ echo ""
2093$ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2094$ rp = "Try to use 64-bit integers, if available? [''bool_dflt'] "
2095$ GOSUB myread
2096$ use64bitint = ans
01aa1a42 2097$!
054a3baf
CB
2098$ bool_dflt = "n"
2099$ IF F$TYPE(use64bitall) .NES. ""
2100$ THEN
2101$ IF use64bitall .OR. use64bitall .eqs. "define" THEN bool_dflt = "y"
2102$ ENDIF
2103$ echo ""
2104$ echo "You may also choose to try maximal 64-bitness. It means using as much"
2105$ echo "64-bitness as possible on the platform. This in turn means even more"
2106$ echo "binary incompatibilities. On the other hand, your platform may not"
2107$ echo "have any more 64-bitness available than what you already have chosen."
2108$ echo ""
2109$ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2110$ rp = "Try to use maximal 64-bit support, if available? [''bool_dflt'] "
2111$ GOSUB myread
2112$ use64bitall=ans
2113$ IF use64bitall .AND. .NOT. use64bitint
2114$ THEN
01aa1a42 2115$ echo ""
054a3baf
CB
2116$ echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
2117$ echo "the use of 64-bit integers."
2118$ use64bitint="Y"
2119$ ENDIF
01aa1a42 2120$!
054a3baf
CB
2121$ bool_dflt = use64bitall
2122$ IF F$TYPE(uselargefiles) .NES. ""
2123$ THEN
2124$ IF uselargefiles .OR. uselargefiles .eqs. "define" THEN bool_dflt = "y"
2125$ ENDIF
2126$ echo ""
2127$ echo "Perl can be built to understand large files (files larger than 2 gigabytes)"
2128$ echo "on some systems. To do so, Configure can be run with -Duselargefiles."
2129$ echo ""
2130$ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2131$ rp = "Try to understand large files, if available? [''bool_dflt'] "
2132$ GOSUB myread
2133$ uselargefiles=ans
01aa1a42 2134$!
054a3baf
CB
2135$ bool_dflt = "n"
2136$ IF F$TYPE(uselongdouble) .NES. ""
2137$ THEN
2138$ IF uselongdouble .OR. uselongdouble .eqs. "define" THEN bool_dflt = "y"
2139$ ENDIF
2140$ echo ""
2141$ echo "Perl can be built to take advantage of long doubles which"
2142$ echo "(if available) may give more accuracy and range for floating point numbers."
2143$ echo ""
2144$ echo "If this does not make any sense to you, just accept the default '" + bool_dflt + "'."
2145$ rp = "Try to use long doubles, if available? [''bool_dflt'] "
2146$ GOSUB myread
2147$ uselongdouble = ans
01aa1a42 2148$!
01aa1a42
CB
2149$!
2150$ IF usesitecustomize .OR. usesitecustomize .eqs. "define"
2151$ THEN
054a3baf 2152$ usesitecustomize = "define"
01aa1a42 2153$ ELSE
054a3baf 2154$ usesitecustomize = "undef"
01aa1a42
CB
2155$ ENDIF
2156$!
498336ed 2157$! Case sensitive?
054a3baf
CB
2158$ echo ""
2159$ echo "By default, perl (and pretty much everything else on VMS) uses"
2160$ echo "case-insensitive linker symbols. Which is to say, when the"
2161$ echo "underlying C code makes a call to a routine called Perl_foo in"
2162$ echo "the source, the name in the object modules or shareable images"
2163$ echo "is really PERL_FOO. There are some packages that use an"
2164$ echo "embedded perl interpreter that instead require case-sensitive"
2165$ echo "linker symbols."
2166$ echo ""
2167$ echo "If you have no idea what this means, and do not have"
2168$ echo "any program requiring anything, choose the default."
2169$ bool_dflt = be_case_sensitive
2170$ if f$type(usecasesensitive) .nes. ""
2171$ then
2172$ if usecasesensitive .or. usecasesensitive .eqs. "define" then bool_dflt = "y"
2173$ if f$extract(0,1,f$edit(usecasesensitive,"collapse,upcase")).eqs."N" .or. usecasesensitive .eqs. "undef" then bool_dflt = "n"
2174$ endif
2175$ rp = "Build with case-sensitive symbols? [''bool_dflt'] "
2176$ GOSUB myread
2177$ be_case_sensitive = ans
1171624b
CB
2178$!
2179$! Shortened symbols?
2180$ echo ""
2181$ echo "The VMS linker does not handle symbol names longer than 31 characters,"
2182$ echo "but the compiler can shorten long symbols if requested."
2183$ bool_dflt = shorten_long_symbols
2184$ if f$type(useshortenedsymbols) .nes. ""
2185$ then
2186$ if useshortenedsymbols .or. useshortenedsymbols .eqs. "define" then bool_dflt = "y"
2187$ if f$extract(0,1,f$edit(useshortenedsymbols,"collapse,upcase")) .eqs. "N" .or. useshortenedsymbols .eqs. "undef" then bool_dflt = "n"
2188$ endif
2189$ rp = "Build with long symbols shortened? [''bool_dflt'] "
2190$ GOSUB myread
2191$ shorten_long_symbols = ans
498336ed 2192$! IEEE math?
054a3baf
CB
2193$ echo ""
2194$ echo "Perl normally uses IEEE format (T_FLOAT) floating point numbers on"
2195$ echo "Alpha and Itanium, but if you need G_FLOAT for binary compatibility"
2196$ echo "with an external library or existing data, you may wish to disable"
2197$ echo "the IEEE math option."
2198$ bool_dflt = use_ieee_math
2199$ if f$type(useieee) .nes. ""
2200$ then
2201$ if useieee .or. useieee .eqs. "define"
9b5c8979 2202$ then
054a3baf
CB
2203$ bool_dflt="y"
2204$ else
2205$ bool_dflt="n"
9b5c8979 2206$ endif
054a3baf
CB
2207$ endif
2208$ rp = "Use IEEE math? [''bool_dflt'] "
2209$ GOSUB myread
2210$ use_ieee_math = ans
9b5c8979
JH
2211$ useieee = "undef"
2212$ usecasesensitive = "undef"
1171624b 2213$ useshortenedsymbols = "undef"
9b5c8979
JH
2214$ if (use_ieee_math) then useieee = "define"
2215$ if (be_case_sensitive) then usecasesensitive = "define"
1171624b 2216$ if (shorten_long_symbols) then useshortenedsymbols = "define"
4adb8845
CB
2217$! Unlink all versions?
2218$ echo ""
2219$ echo "By default, Perl's unlink() provides VMS-like behavior and only"
2220$ echo "deletes the latest version of a file. Enabling this option builds"
2221$ echo "Perl so that unlink() deletes all versions of a file."
2222$ bool_dflt = unlink_all_versions
2223$ if f$type(unlink_all_versions) .nes. ""
2224$ then
2225$ if unlink_all_versions .or. unlink_all_versions .eqs. "define"
2226$ then
2227$ bool_dflt="y"
2228$ else
2229$ bool_dflt="n"
2230$ endif
2231$ endif
2232$ rp = "Make unlink() delete all versions of a file? [''bool_dflt'] "
2233$ GOSUB myread
2234$ unlink_all_versions = ans
2235$ IF unlink_all_versions
2236$ THEN
2237$ d_unlink_all_versions = "define"
2238$ ELSE
2239$ d_unlink_all_versions = "undef"
2240$ ENDIF
e9df20f7 2241$!
498336ed
CB
2242$! CC Flags
2243$ echo ""
7558ebc2
PP
2244$ echo "Your compiler may want other flags. For this question you should include"
2245$ echo "/INCLUDE=(whatever) and /DEFINE=(whatever), flags and any other flags"
2246$ echo "or qualifiers used by the compiler."
2247$ echo ""
2248$ echo "To use no flags, specify the word ""none""."
498336ed 2249$ dflt = user_c_flags
7558ebc2
PP
2250$ rp = "Any additional cc flags? [''dflt'] "
2251$ GOSUB myread
7558ebc2 2252$ IF ans .EQS. "none" THEN ans = ""
498336ed 2253$ user_c_flags = "''ans'"
97abc6ad 2254$!
cc391245
CB
2255$! Ask whether they want to use secure logical translation when tainting
2256$ echo ""
2257$ echo "As Perl starts up, it checks several logical names, such as"
2258$ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
2259$ echo "of its behavior. For additional security, you may limit this"
2260$ echo "process to executive- and kernel-mode translation when tainting"
2261$ echo "is enabled. In this case, logical names normally skipped when"
2262$ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
2263$ echo "If you do not choose to do this, the usual order of access modes"
2264$ echo "is used for logical name translation."
2265$ echo ""
2266$ echo "This restriction does not apply to the %ENV hash or to implicit"
2267$ echo "logical name translation during parsing of file specifications;"
2268$ echo "these always use the normal sequence of access modes for logical"
2269$ echo "name translation."
9b5c8979
JH
2270$ bool_dflt = "y"
2271$ if f$type(usesecurelog) .nes. ""
2272$ then
2273$ if f$extract(0,1,f$edit(usesecurelog,"collapse,upcase")).eqs."N" .or. usesecurelog .eqs. "undef" then bool_dflt = "n"
2274$ endif
2275$ rp = "Use secure logical name translation? [''bool_dflt'] "
cc391245 2276$ GOSUB myread
9b5c8979
JH
2277$ d_secintgenv = ans
2278$ usesecurelog = "undef"
2279$ if (d_secintgenv) then usesecurelog = "define"
cc391245
CB
2280$!
2281$! Ask whether they want to default filetypes
2282$ echo ""
2283$ echo "When you pass the name of a program to Perl on the command line,"
2284$ echo "it generally doesn't supply any defaults unless the -S command"
2285$ echo "line switch is specified. In keeping with the VMS tradition of"
2286$ echo "default file types, however, you can configure Perl to try default"
2287$ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
2288$ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
2289$ echo "finally foo.com)."
8c99d73e 2290$ echo ""
7558ebc2
PP
2291$ echo "This is currently broken in some configurations. Only enable it if"
2292$ echo "you know what you are doing."
9b5c8979
JH
2293$ bool_dflt = "n"
2294$ if f$type(usedefaulttypes) .nes. ""
2295$ then
2296$ if usedefaulttypes .or. usedefaulttypes .eqs. "define" then bool_dflt="y"
2297$ endif
2298$ rp = "Always use default file types? [''bool_dflt'] "
cc391245 2299$ GOSUB myread
9b5c8979
JH
2300$ d_alwdeftype = ans
2301$ usedefaulttypes = "undef"
2302$ if (d_alwdeftype) then usedefaulttypes = "define"
2303$!
4581ada3
CB
2304$ dflt = archname
2305$ rp = "What is your architecture name? [''archname'] "
2306$ GOSUB myread
2307$ IF ans.NES.""
2308$ THEN
2309$ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
2310$ IF (ans.NES.archname) !.AND.knowitall
2311$ THEN
2312$ echo4 "I'll go with ''archname' anyway..."
2313$ ENDIF
2314$ ENDIF
35182409 2315$!
139a355e
CB
2316$ bool_dflt = "n"
2317$ if f$type(useversionedarchname) .nes. ""
2318$ then
2319$ if useversionedarchname .or. useversionedarchname .eqs. "define" then bool_dflt = "y"
2320$ endif
2321$ rp = "Add the Perl API version to your archname? [''bool_dflt'] "
2322$ GOSUB myread
2323$ IF ans
2324$ THEN
2325$ useversionedarchname = "define"
2326$ IF F$LOCATE("-''version'", archname) .EQ. F$LENGTH(archname)
2327$ THEN
2328$ archname = "''archname'-''version'"
2329$ echo4 "...setting architecture name to ''archname'."
2330$ ELSE
2331$ echo4 "...and architecture name already has -''version'."
2332$ ENDIF
2333$ ELSE
2334$ useversionedarchname = "undef"
2335$ ENDIF
2336$!
35182409
CB
2337$ IF usethreads .OR. usethreads .EQS. "define"
2338$ THEN
2339$ echo4 "Threads selected."
2340$ IF F$LOCATE("-thread", archname) .EQ. F$LENGTH(archname)
2341$ THEN
2342$ archname = "''archname'-thread"
2343$ echo4 "...setting architecture name to ''archname'."
2344$ ELSE
2345$ echo4 "...and architecture name already has -thread."
2346$ ENDIF
2347$ ENDIF
2348$!
2349$ IF usemultiplicity .OR. usemultiplicity .EQS. "define"
2350$ THEN
2351$ echo4 "Multiplicity selected."
2352$ IF F$LOCATE("-multi", archname) .EQ. F$LENGTH(archname)
2353$ THEN
2354$ archname = "''archname'-multi"
2355$ echo4 "...setting architecture name to ''archname'."
2356$ ELSE
2357$ echo4 "...and architecture name already has -multi."
2358$ ENDIF
2359$ ENDIF
2360$!
2361$ IF uselongdouble .OR. uselongdouble .EQS. "define"
2362$ THEN
2363$ echo4 "Long doubles selected."
2364$ IF F$LOCATE("-ld", archname) .EQ. F$LENGTH(archname)
2365$ THEN
2366$ archname = "''archname'-ld"
2367$ echo4 "...setting architecture name to ''archname'."
2368$ ELSE
2369$ echo4 "...and architecture name already has -ld."
2370$ ENDIF
2371$ ENDIF
2372$!
4581ada3
CB
2373$ bool_dflt = "n"
2374$ vms_prefix = "perl_root"
2375$ vms_prefixup = F$EDIT(vms_prefix,"UPCASE")
2376$ rp = "Will you be sharing your ''vms_prefixup' with ''otherarch'? [''bool_dflt'] "
2377$ GOSUB myread
2378$ IF .NOT. ans
2379$ THEN
2380$ sharedperl = "N"
2381$ ELSE
2382$ sharedperl = "Y"
2383$ IF (F$ELEMENT(0, "-", archname).EQS."VMS_AXP")
2384$ THEN
2385$ macros = macros + """AXE=1"","
2386$ ENDIF
2387$ IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
2388$ THEN
2389$ macros = macros + """IXE=1"","
2390$ ENDIF
2391$ ENDIF
2392$!
2393$!: is AFS running? !sfn
2394$!: decide how portable to be. Allow command line overrides. !sfn
2395$!: set up shell script to do ~ expansion !sfn
2396$!: expand filename !sfn
2397$!: now set up to get a file name !sfn
2398$!
2399$ IF F$TYPE(prefix) .EQS. ""
2400$ THEN
2401$ prefix = F$ENVIRONMENT("DEFAULT") - ".UU]" + "]"
2402$ prefix = F$PARSE(prefix,,,,"NO_CONCEAL") - "][" - "000000." - ".000000" - ".;"
2403$ prefixbase = prefix - "]"
2404$! Add _ROOT to make install PERL_ROOT differ from build directory.
2405$ prefix = prefixbase + "_ROOT.]"
2406$ ENDIF
2407$ ! more redundant scrubbing of values
2408$ prefix = prefix - "000000."
2409$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
c556ea94 2410$ src = prefix - "_ROOT."
4581ada3
CB
2411$!: determine root of directory hierarchy where package will be installed.
2412$ dflt = prefix
2413$ IF .NOT.silent
2414$ THEN
2415$ echo ""
2416$ echo "By default, ''package' will be installed in ''dflt', pod"
2417$ echo "pages under ''prefixbase'.LIB.POD], etc..., i.e. with ''dflt' as prefix for"
2418$ echo "all installation directories."
2419$ echo "On ''osname' the prefix is used to DEFINE the ''vms_prefixup' prior to installation"
2420$ echo "as well as during subsequent use of ''package' via ''packageup'_SETUP.COM."
2421$ ENDIF
2422$ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
2423$ GOSUB myread
2424$ IF ans.NES.""
2425$ THEN
2426$ prefix = ans
2427$ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
2428$ ELSE
2429$ prefix = dflt
2430$ ENDIF
2431$ perl_root = prefix
2432$!
2433$! Check here for pre-existing PERL_ROOT.
2434$! -> ask if removal desired.
2435$! Check here for writability of requested PERL_ROOT if it is not the default (cwd).
2436$! -> recommend letting PERL_ROOT be PERL_SRC if requested PERL_ROOT is not writable.
2437$!
2438$ tmp = perl_root - ".]" + "]"
2439$ dflt = f$parse(tmp,,,,)
2440$ IF dflt .eqs. ""
2441$ THEN
2442$ echo4 "''tmp' does not yet exist."
2443$! create/directory 'tmp'
2444$ ELSE
2445$ echo4 "''tmp' already exists."
2446$ ENDIF
2447$!
2448$ vms_skip_install = "true"
2449$ bool_dflt = "y"
2450$! echo ""
2451$ rp = "Skip the remaining """"where install"""" questions? [''bool_dflt'] "
2452$ GOSUB myread
2453$ IF (.NOT.ans) THEN vms_skip_install = "false"
2454$ IF (.NOT.vms_skip_install)
2455$ THEN
2456$!
2457$!: set the prefixit variable, to compute a suitable default value
2458$!
2459$!: determine where private library files go
2460$!: Usual default is /usr/local/lib/perl5. Also allow things like
2461$!: /opt/perl/lib, since /opt/perl/lib/perl5 would be redundant.
2462$ IF .NOT.silent
2463$ THEN
2464$ TYPE SYS$INPUT:
2465$ DECK
2466
2467There are some auxiliary files for perl5 that need to be put into a
2468private library directory that is accessible by everyone.
2469$ EOD
2470$ ENDIF
2471$ IF F$TYPE(privlib) .NES. ""
2472$ THEN dflt = privlib
097f20ec 2473$ ELSE dflt = "/''vms_prefix'/lib"
4581ada3
CB
2474$ ENDIF
2475$ rp = "Pathname where the private library files will reside? "
2476$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2477$ GOSUB myread
2478$ privlib = ans
2479$!
2480$ ENDIF !%Config-I-VMS, skip remaining "where install" questions
2481$!
2482$ IF F$TYPE(perl_symbol) .EQS. "" THEN perl_symbol := true
2483$ IF F$TYPE(perl_verb) .EQS. "" THEN perl_verb = ""
2484$ IF perl_symbol
2485$ THEN bool_dflt = "y"
2486$ ELSE bool_dflt = "n"
2487$ ENDIF
2488$ IF .NOT.silent
2489$ THEN
2490$ echo ""
2491$ echo "You may choose to write ''packageup'_SETUP.COM to assign a foreign"
2492$ echo "symbol to invoke ''package', which is the usual method."
2493$ echO "If you do not do so then you would need a DCL command verb at the"
2494$ echo "process or the system wide level."
2495$ ENDIF
2496$ rp = "Invoke perl as a global symbol foreign command? [''bool_dflt'] "
2497$ GOSUB myread
2498$ IF (.NOT.ans) THEN perl_symbol = "false"
2499$!
2500$ IF (.NOT.perl_symbol)
2501$ THEN
2502$ IF perl_verb .EQS. "DCLTABLES"
2503$ THEN bool_dflt = "n"
2504$ ELSE bool_dflt = "y"
2505$ ENDIF
2506$ IF .NOT.silent
2507$ THEN
2508$ echo ""
2509$ echo "Since you won't be using a symbol you must choose to put the ''packageup'"
2510$ echo "verb in a per-process table or in the system wide DCLTABLES (which"
2511$ echo "would require write privilege)."
2512$ ENDIF
2513$ rp = "Invoke perl as a per process command verb? [ ''bool_dflt' ] "
2514$ GOSUB myread
2515$ IF (.NOT.ans)
2516$ THEN perl_verb = "DCLTABLES"
2517$ ELSE perl_verb = "PROCESS"
2518$ ENDIF
2519$ ENDIF ! (.NOT.perl_symbol)
2520$!
2521$ IF (.NOT.vms_skip_install)
2522$ THEN
2523$!: set the prefixup variable, to restore leading tilde escape !sfn
2524$!
2525$!: determine where public architecture dependent libraries go
2526$ IF (.NOT.silent)
2527$ THEN
2528$ echo ""
2529$ echo "''package' contains architecture-dependent library files. If you are"
2530$ ENDIF
2531$ IF (.NOT.silent)
2532$ THEN
2533$ TYPE SYS$INPUT:
2534$ DECK
2535sharing libraries in a heterogeneous environment, you might store
2536these files in a separate location. Otherwise, you can just include
2537them with the rest of the public library files.
2538$ EOD
2539$ ENDIF
2540$ IF F$TYPE(archlib) .NES. ""
2541$ THEN dflt = archlib
097f20ec 2542$ ELSE dflt = privlib + "/" + archname + "/" + version
4581ada3
CB
2543$ ENDIF
2544$ rp = "Where do you want to put the public architecture-dependent libraries? "
2545$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2546$ GOSUB myread
2547$ archlib = ans
2548$!
2549$ ENDIF !%Config-I-VMS, skip "where install" questions
2550$ IF (.NOT.vms_skip_install)
2551$ THEN
2552$!: it so happens the Eunice I know will not run shell scripts in Unix format
2553$!
2554$!: see if setuid scripts can be secure !sfn
2555$!: now see if they want to do setuid emulation !sfn
2556$!
2557$!: determine where site specific libraries go.
2558$ IF .NOT.silent
2559$ THEN
2560$ TYPE SYS$INPUT:
2561$ DECK
2562
2563The installation process will also create a directory for
2564site-specific extensions and modules. Some users find it convenient
2565to place all local files in this directory rather than in the main
2566distribution directory.
2567$ EOD
2568$ ENDIF
2569$ IF F$TYPE(sitelib) .NES. ""
2570$ THEN dflt = sitelib
097f20ec 2571$ ELSE dflt = privlib + "/site_perl"
4581ada3
CB
2572$ ENDIF
2573$ rp = "Pathname for the site-specific library files? "
2574$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2575$ GOSUB myread
2576$ sitelib = ans
2577$!
2578$!: determine where site specific architecture-dependent libraries go.
2579$ IF .NOT.silent
2580$ THEN TYPE SYS$INPUT:
2581$ DECK
2582
2583The installation process will also create a directory for
2584architecture-dependent site-specific extensions and modules.
2585$ EOD
2586$ ENDIF
2587$ IF F$TYPE(sitearch) .NES. ""
2588$ THEN dflt = sitearch
097f20ec 2589$ ELSE dflt = sitelib + "/" + archname
4581ada3
CB
2590$ ENDIF
2591$ rp = "Pathname for the site-specific architecture-dependent library files? "
2592$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2593$ GOSUB myread
2594$ sitearch = ans
2595$!
2596$!: determine where old public architecture dependent libraries might be
2597$!
2598$!: determine where public executables go
2599$ IF F$TYPE(bin) .NES. ""
2600$ THEN dflt = bin
4581ada3
CB
2601$ ELSE dflt = "/''vms_prefix'"
2602$ ENDIF
2603$ rp = "Pathname where the public executables will reside? "
2604$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2605$ GOSUB myread
2606$ bin = ans
2607$!
2608$!: determine where add-on public executables go
2609$ IF F$TYPE(sitebin) .NES. ""
2610$ THEN dflt = sitebin
097f20ec 2611$ ELSE dflt = "/''vms_prefix'/bin/''archname'"
4581ada3
CB
2612$ ENDIF
2613$ rp = "Pathname where the add-on public executables should be installed? "
2614$ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2615$ GOSUB myread
2616$ sitebin = ans
2617$!
2618$!: determine where manual pages are on this system
2619$!: What suffix to use on installed man pages
2620$!: see if we can have long filenames
2621$!: determine where library module manual pages go
2622$!: What suffix to use on installed man pages
2623$!: see what memory models we can support
2624$!
2625$ ELSE ! skipping "where install" questions, we must set some symbols
2626$ IF F$TYPE(archlib).EQS."" THEN -
097f20ec 2627 archlib="/''vms_prefix'/lib/''archname'/''version'"
4581ada3
CB
2628$ IF F$TYPE(bin) .EQS. "" THEN -
2629 bin="/''vms_prefix'"
2630$ IF F$TYPE(privlib) .EQS. "" THEN -
097f20ec 2631 privlib ="/''vms_prefix'/lib"
4581ada3 2632$ IF F$TYPE(sitearch) .EQS. "" THEN -
097f20ec 2633 sitearch="/''vms_prefix'/lib/site_perl/''archname'"
4581ada3 2634$ IF F$TYPE(sitelib) .EQS. "" THEN -
097f20ec 2635 sitelib ="/''vms_prefix'/lib/site_perl"
4581ada3 2636$ IF F$TYPE(sitebin) .EQS. "" THEN -
097f20ec 2637 sitebin="/''vms_prefix'/bin/''archname'"
4581ada3
CB
2638$ ENDIF !%Config-I-VMS, skip "where install" questions
2639$!
2640$! These derived locations can be set whether we've opted to
2641$! skip the where install questions or not.
2642$!
2643$ IF F$TYPE(archlibexp) .EQS. "" THEN -
097f20ec 2644 archlibexp="/''vms_prefix'/lib/''archname'/''version'"
4581ada3 2645$ IF F$TYPE(binexp) .EQS. "" THEN -
097f20ec 2646 binexp ="/''vms_prefix'"
4581ada3 2647$ IF F$TYPE(builddir) .EQS. "" THEN -
097f20ec 2648 builddir ="/''vms_prefix'"
4581ada3 2649$ IF F$TYPE(installarchlib) .EQS. "" THEN -
097f20ec 2650 installarchlib="/''vms_prefix'/lib/''archname'/''version'"
4581ada3 2651$ IF F$TYPE(installbin) .EQS. "" THEN -
097f20ec 2652 installbin ="/''vms_prefix'"
4581ada3 2653$ IF F$TYPE(installscript) .EQS. "" THEN -
097f20ec 2654 installscript ="/''vms_prefix'/utils"
4581ada3 2655$ IF F$TYPE(installman1dir) .EQS. "" THEN -
097f20ec 2656 installman1dir ="/''vms_prefix'/man/man1"
4581ada3 2657$ IF F$TYPE(installman3dir) .EQS. "" THEN -
097f20ec 2658 installman3dir ="/''vms_prefix'/man/man3"
4581ada3 2659$ IF F$TYPE(installprivlib) .EQS. "" THEN -
097f20ec 2660 installprivlib ="/''vms_prefix'/lib"
4581ada3 2661$ IF F$TYPE(installsitearch) .EQS. "" THEN -
097f20ec 2662 installsitearch="/''vms_prefix'/lib/site_perl/''archname'"
4581ada3 2663$ IF F$TYPE(installsitelib) .EQS. "" THEN -
097f20ec 2664 installsitelib ="/''vms_prefix'/lib/site_perl"
4581ada3 2665$ IF F$TYPE(oldarchlib) .EQS. "" THEN -
097f20ec 2666 oldarchlib="/''vms_prefix'/lib/''archname'"
4581ada3 2667$ IF F$TYPE(oldarchlibexp) .EQS. "" THEN -
097f20ec 2668 oldarchlibexp="/''vms_prefix'/lib/''archname'"
4581ada3 2669$ IF F$TYPE(privlibexp) .EQS. "" THEN -
097f20ec 2670 privlibexp ="/''vms_prefix'/lib"
4581ada3 2671$ IF F$TYPE(scriptdir) .EQS. "" THEN -
097f20ec 2672 scriptdir ="/''vms_prefix'/utils"
4581ada3 2673$ IF F$TYPE(sitearchexp) .EQS. "" THEN -
097f20ec 2674 sitearchexp ="/''vms_prefix'/lib/site_perl/''archname'"
4581ada3 2675$ IF F$TYPE(sitelib_stem) .EQS. "" THEN -
097f20ec 2676 sitelib_stem ="/''vms_prefix'/lib/site_perl"
4581ada3 2677$ IF F$TYPE(sitelibexp) .EQS. "" THEN -
097f20ec 2678 sitelibexp ="/''vms_prefix'/lib/site_perl"
4581ada3 2679$!
dc8c9d5a
CB
2680$! determine whether to use malloc wrapping
2681$ echo ""
dc9da78b 2682$ bool_dflt = "y"
dc8c9d5a
CB
2683$ IF F$TYPE(usemallocwrap) .nes. ""
2684$ then
dc9da78b 2685$ if .NOT. usemallocwrap .or. usemallocwrap .eqs. "undef" then bool_dflt = "n"
dc8c9d5a
CB
2686$ endif
2687$ rp = "Do you wish to wrap malloc calls to protect against potential overflows? [''bool_dflt'] "
2688$ GOSUB myread
2689$ IF ans
2690$ THEN usemallocwrap = "define"
2691$ ELSE usemallocwrap = "undef"
2692$ ENDIF
2693$!
97abc6ad
HM
2694$! Ask if they want to use perl's memory allocator
2695$ echo ""
7558ebc2
PP
2696$ echo "Perl has a built-in memory allocator that is tuned for normal"
2697$ echo "memory usage. It is oftentimes better than the standard system"
2698$ echo "memory allocator. It also has the advantage of providing memory"
2699$ echo "allocation statistics, if you choose to enable them."
9b5c8979
JH
2700$ bool_dflt = "n"
2701$ IF F$TYPE(usemymalloc) .nes. ""
2702$ then
2703$ if usemymalloc .or. usemymalloc .eqs. "define" then bool_dflt = "y"
2704$ endif
2705$ rp = "Do you wish to attempt to use the malloc that comes with ''package'? [''bool_dflt'] "
97abc6ad 2706$ GOSUB myread
9b5c8979 2707$ mymalloc = ans
570bb66e 2708$ IF mymalloc
429a5e67 2709$ THEN
570bb66e 2710$ IF use_debugging_perl
429a5e67
DS
2711$ THEN
2712$ echo ""
7558ebc2
PP
2713$ echo "Perl can keep statistics on memory usage if you choose to use"
2714$ echo "them. This is useful for debugging, but does have some"
2715$ echo "performance overhead."
9b5c8979
JH
2716$ bool_dflt = "n"
2717$ rp = "Do you want the debugging memory allocator? [''bool_dflt'] "
429a5e67 2718$ gosub myread
9b5c8979 2719$ use_debugmalloc = ans
429a5e67
DS
2720$ ENDIF
2721$ ! Check which memory allocator we want
2722$ echo ""
7558ebc2
PP
2723$ echo "There are currently three different memory allocators: the"
2724$ echo "default (which is a pretty good general-purpose memory manager),"
2725$ echo "the TWO_POT allocator (which is optimized to save memory for"
2726$ echo "larger allocations), and PACK_MALLOC (which is optimized to save"
2727$ echo "memory for smaller allocations). They're all good, but if your"
2728$ echo "usage tends towards larger chunks use TWO_POT, otherwise use"
429a5e67 2729$ echo "PACK_MALLOC."
429a5e67
DS
2730$ dflt = "DEFAULT"
2731$ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2732$ GOSUB myread
429a5e67
DS
2733$ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2734$ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2735$ ENDIF
97abc6ad 2736$!
86ad859e 2737$ xs_extensions = ""
a3bd614a
PP
2738$ xxx = ""
2739$ OPEN/READ CONFIG 'manifestfound'
2740$ext_loop:
2741$ READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
0189e3e0 2742$ IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
a193a2db 2743 F$EXTRACT(0,5,line) .NES. "dist/".AND. -
0189e3e0 2744 F$EXTRACT(0,5,line) .NES. "cpan/" THEN goto ext_loop
a3bd614a
PP
2745$ line = F$EDIT(line,"COMPRESS")
2746$ line = F$ELEMENT(0," ",line)
619cec6d
CB
2747$ IF F$EXTRACT(0,4,line) .EQS. "ext/"
2748$ THEN
2749$ xxx = F$ELEMENT(1,"/",line)
2750$ IF F$SEARCH("[-.ext]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2751$ ENDIF
a193a2db
NC
2752$ IF F$EXTRACT(0,5,line) .EQS. "dist/"
2753$ THEN
2754$ xxx = F$ELEMENT(1,"/",line)
2755$ IF F$SEARCH("[-.dist]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2756$ ENDIF
0189e3e0
NC
2757$ IF F$EXTRACT(0,5,line) .EQS. "cpan/"
2758$ THEN
2759$ xxx = F$ELEMENT(1,"/",line)
2760$ IF F$SEARCH("[-.cpan]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2761$ ENDIF
a3bd614a 2762$ IF xxx .EQS. "DynaLoader" THEN goto ext_loop ! omit
1f29050e
NC
2763$!
2764$! (extspec = xxx) =~ tr!-!/!
2765$ extspec = ""
2766$ idx = 0
d1ce36d7 2767$ extension_dir_name = xxx
1f29050e
NC
2768$ replace_dash_with_slash:
2769$ before = F$ELEMENT(idx, "-", xxx)
2770$ IF before .EQS. "-" THEN goto end_replace_dash_with_slash
2771$ IF extspec .NES. ""
2772$ THEN
2773$ extspec = extspec + "/"
2774$ ENDIF
2775$ extspec = extspec + before
2776$ idx = idx + 1
2777$ goto replace_dash_with_slash
2778$
2779$ end_replace_dash_with_slash:
3f6115a7
CB
2780$!
2781$ IF extspec .EQS. "Scalar/List/Utils" THEN extspec = "List/Util"
2782$ IF extspec .EQS. "PathTools" THEN extspec = "Cwd"
2783$!
86ad859e 2784$ xxx = xs_extensions
d1ce36d7
CB
2785$ gosub may_already_have_extension
2786$ IF $STATUS .EQ. 1
2787$ THEN
2788$ xxx = nonxs_ext
2789$ gosub may_already_have_extension
2790$ ENDIF
bd2aeadf
CB
2791$ IF $STATUS .EQ. 1
2792$ THEN
2793$ xxx = nonxs_ext2
2794$ gosub may_already_have_extension
2795$ ENDIF
d1ce36d7
CB
2796$ IF $STATUS .NE. 1 THEN goto ext_loop
2797$ goto found_new_extension
2798$!
619cec6d
CB
2799$ may_already_have_extension:
2800$ idx = F$LOCATE(extspec, xxx)
2801$ extlen = F$LENGTH(xxx)
bd2aeadf
CB
2802$ IF idx .EQ. extlen THEN return 1 ! didn't find it
2803$! But "Flirble" may just be part of "Acme-Flirble". This is not
2804$! bullet-proof because we may only be looking at one chunk of the
2805$! existing extension list.
619cec6d
CB
2806$ IF idx .GT. 0 .AND. F$EXTRACT(idx - 1, 1, xxx) .NES. " "
2807$ THEN
2808$ xxx = F$EXTRACT(idx + F$LENGTH(extspec) + 1, extlen, xxx)
2809$ GOTO may_already_have_extension
2810$ ENDIF
2811$! But "Foo" may just be part of "Foo-Bar" so check for equality.
2812$ xxx = F$EXTRACT(idx, extlen - idx, xxx)
2813$ IF F$ELEMENT(0, " ", xxx) .EQS. extspec
2814$ THEN
d1ce36d7 2815$ RETURN 3
619cec6d
CB
2816$ ELSE
2817$ xxx = F$EXTRACT(F$LENGTH(extspec) + 1, extlen, xxx)
2818 GOTO may_already_have_extension
2819$ ENDIF
2820$!
2821$ found_new_extension:
86ad859e
CB
2822$ IF F$SEARCH("[-.ext.''extension_dir_name']*.xs") .EQS. "" -
2823 .AND. F$SEARCH("[-.dist.''extension_dir_name']*.xs") .EQS. "" -
2824 .AND. F$SEARCH("[-.cpan.''extension_dir_name']*.xs") .EQS. "" -
2825 .AND. extension_dir_name .NES. "VMS-Filespec"
d1ce36d7 2826$ THEN
bd2aeadf
CB
2827$! Bit if a hack to get around the 1K buffer on older systems.
2828$ IF F$LENGTH(nonxs_ext) .GT. 950
2829$ THEN
2830$ nonxs_ext2 = nonxs_ext2 + " ''extspec'"
2831$ ELSE
2832$ nonxs_ext = nonxs_ext + " ''extspec'"
2833$ ENDIF
0189e3e0 2834$ ELSE
86ad859e 2835$ xs_extensions = xs_extensions + " ''extspec'"
d1ce36d7 2836$ ENDIF
a3bd614a
PP
2837$ goto ext_loop
2838$end_ext:
2839$ close CONFIG
2840$ DELETE/SYMBOL xxx
1f29050e
NC
2841$ DELETE/SYMBOL idx
2842$ DELETE/SYMBOL extspec
619cec6d 2843$ DELETE/SYMBOL extlen
d1ce36d7 2844$ DELETE/SYMBOL extension_dir_name
86ad859e
CB
2845$ xs_extensions = F$EDIT(xs_extensions,"TRIM,COMPRESS")
2846$ dflt = xs_extensions
a3bd614a
PP
2847$ dflt = dflt - "ByteLoader" ! needs to be ported
2848$ dflt = dflt - "DB_File" ! needs to be ported
2849$ dflt = dflt - "GDBM_File" ! needs porting/special library
1f29050e 2850$ dflt = dflt - "IPC/SysV" ! needs to be ported
a3bd614a
PP
2851$ dflt = dflt - "NDBM_File" ! needs porting/special library
2852$ dflt = dflt - "ODBM_File" ! needs porting/special library
1f29050e 2853$ dflt = dflt - "Sys/Syslog" ! needs porting/special library "GDBM_File macro LOG_DEBUG"
046cc26c 2854$ IF .NOT. Has_Dec_C_Sockets
9b5878df
CB
2855$ THEN
2856$ dflt = dflt - "Socket" ! optional on VMS
2857$ ENDIF
d1ce36d7 2858$ dflt = dflt - "Win32API/File" - "Win32" ! need Dave Cutler's other project
1f63856e 2859$ dflt = dflt - "Amiga/ARexx" - "Amiga/Exec" ! this is not AmigaOS
d1ce36d7 2860$ nonxs_ext = nonxs_ext - "Win32CORE"
bd2aeadf 2861$ nonxs_ext2 = nonxs_ext2 - "Win32CORE"
a3bd614a 2862$ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
d1ce36d7 2863$ nonxs_ext = F$EDIT(nonxs_ext,"TRIM,COMPRESS")
bd2aeadf 2864$ nonxs_ext2 = F$EDIT(nonxs_ext2,"TRIM,COMPRESS")
a3bd614a 2865$!
97abc6ad
HM
2866$! Ask for their default list of extensions to build
2867$ echo ""
7558ebc2
PP
2868$ echo "It is time to specify which modules you want to build into"
2869$ echo "perl. Most of these are standard and should be chosen, though"
2870$ echo "you might, for example, want to build GDBM_File instead of"
2871$ echo "SDBM_File if you have the GDBM library built on your machine."
2872$ echo ""
97abc6ad 2873$ echo "Which modules do you want to build into perl?"
97abc6ad
HM
2874$ rp = "[''dflt'] "
2875$ GOSUB myread
63d52911 2876$ dynamic_ext = F$EDIT(ans,"TRIM,COMPRESS")
97abc6ad
HM
2877$!
2878$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2879$ echo ""
570bb66e 2880$ echo "Checking your ""make"" utilities..."
97abc6ad
HM
2881$! If the 'build' that you use is not here add it and it's test
2882$! switch to the _END_ of these strings (and increment max_build)
2883$! (e.g. builders = builders + "/FOOMAKE"
2884$! probers = probers + " -fooVersionSwitch"
2885$! ) & please let me know about it.
2886$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2887$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2888$ max_build = 7
2889$!
96021e87
JM
2890$ orig_dflt = f$edit(builder,"UPCASE")
2891$ if orig_dflt .eqs. "" then orig_dflt = "MMK"
97abc6ad
HM
2892$ default_set = ""
2893$ ok_builders = ""
2894$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2895$ WRITE CONFIG "dont_make_anything_yet:"
2896$ WRITE CONFIG F$FAO("!_")
2897$ CLOSE CONFIG
2898$ n = 0
2899$ messages = F$ENVIRONMENT("MESSAGE")
2900$Build_probe:
2901$ build = F$ELEMENT(n,"/",builders)
2902$ probe = F$ELEMENT(n,"!",probers)
2903$ echo "Testing whether you have ''build' on your system..."
570bb66e
JH
2904$!
2905$! Noted with GNU Make version 3.60 that the $status and $severity
2906$! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2907$! $SEVERITY == "4".
2908$!
a3ef2c6f
GS
2909$ SET NOON
2910$ ON CONTROL_Y THEN GOTO Reenable_messages_build
2911$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
97abc6ad 2912$ 'build' 'probe'
570bb66e 2913$ IF ($SEVERITY .EQ. 1) ! not adequate?
97abc6ad
HM
2914$ THEN
2915$ echo "OK."
2916$ IF (build .EQS. orig_dflt)
2917$ THEN
2918$ default_set = "TRUE"
2919$ dflt = build
2920$ ENDIF
2921$ ok_builders = ok_builders + " " + build
2922$ IF (.NOT. default_set) THEN dflt = build
2923$ ELSE
2924$ echo "Nope."
2925$ ENDIF
a3ef2c6f
GS
2926$Reenable_messages_build:
2927$ SET MESSAGE 'messages'
2928$ SET ON
9b5c8979 2929$ on control_y then goto clean_up
97abc6ad
HM
2930$ n = n + 1
2931$ IF (n .LT. max_build) THEN GOTO Build_probe
2932$!
2933$ echo ""
2934$ IF (ok_builders .NES. "")
2935$ THEN
2936$ echo "Here is the list of builders you can apparently use:"
2937$ echo "(",ok_builders," )"
a5fddd44 2938$ rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
97abc6ad
HM
2939$ GOSUB myread
2940$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2941$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2942$ IF (ans .EQS. "")
2943$ THEN build = dflt
2944$ ELSE build = ans
2945$ ENDIF
2946$ ELSE
2947$ TYPE SYS$INPUT:
7558ebc2 2948$ DECK
97abc6ad
HM
2949
2950%Config-E-VMS, ERROR:
2951 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2952 utility of some sort and after checking my "builders" list I cannot find
2953 the symbol or command you use on your system to compile programs.
2954
7558ebc2 2955$ EOD
570bb66e 2956$ READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
97abc6ad
HM
2957$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2958$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2959$ IF (ans .EQS. "")
2960$ THEN build = dflt
7558ebc2 2961$ echo "I do not know where ""make"" is, and my life depends on it."
97abc6ad
HM
2962$ echo "Go find a make program or fix your DCL$PATH setting!"
2963$ echo "ABORTING..."
2964$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2965$ STOP
2966$ EXIT 2 !$STATUS = "%X00000002" (error)
2967$ ELSE
2968$ build = ans
2969$ ENDIF
2970$ ENDIF
2971$!
fcc434ad 2972$ DELETE/NOLOG/NOCONFIRM Makefile.;
97abc6ad
HM
2973$ GOTO Beyond_open
2974$Open_error:
2975$ TYPE SYS$INPUT:
7558ebc2 2976$ DECK
97abc6ad
HM
2977
2978 There seems to be trouble. I just tried to create a file in
7558ebc2 2979$ EOD
97abc6ad
HM
2980$ echo4 'F$ENVIRONMENT("DEFAULT")'
2981$ TYPE SYS$INPUT:
7558ebc2 2982$ DECK
97abc6ad
HM
2983 but was unsuccessful. I am stopping now. Please check that directories'
2984 PROTECTION bits. I will leave you in the directory where you started
2985 Configure.com
7558ebc2 2986$ EOD
97abc6ad
HM
2987$ echo4 "ABORTING..."
2988$ GOTO Clean_up
2989$ STOP
2990$ EXIT
2991$!
2992$Beyond_open:
2993$! echo " Very well I will proceed with ""''build'"""
2994$ make = F$EDIT(build,"UPCASE")
2995$!
2996$!: locate the preferred pager for this system
2997$!pagers = "most|more|less|type/page"
936f6df1
CB
2998$ IF osvers .GES. "V6.1"
2999$ THEN
3000$ dflt = "type/page=save=10"
3001$ ELSE
3002$ dflt = "type/page"
3003$ ENDIF
dfe814dc
PP
3004$! assume that the presence of a most symbol indicates the presence
3005$! of the pager.
3006$ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
3007$ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
3008$ rp="What pager is used on your system? [''dflt'] "
3009$ GOSUB myread
9b5c8979 3010$ pager = ans
97abc6ad 3011$!
c6159718
CB
3012$ bool_dflt = "y"
3013$ IF F$TYPE(default_inc_excludes_dot) .NES. ""
3014$ THEN
3015$ IF .not. default_inc_excludes_dot .or. default_inc_excludes_dot .eqs. "undef" THEN bool_dflt = "n"
3016$ ENDIF
3017$ echo ""
3018$ echo "Historically Perl has provided a final fallback of the current working"
3019$ echo "directory '.' when searching for a library. This, however, can lead to"
3020$ echo "problems when a Perl program which loads optional modules is called from"
3021$ echo "a shared directory. This can lead to executing unexpected code."
3022$ echo ""
3023$ rp = "Exclude '.' from @INC by default? [''bool_dflt'] "
3024$ GOSUB myread
3025$ default_inc_excludes_dot = ans
3026$ IF default_inc_excludes_dot
3027$ THEN
3028$ default_inc_excludes_dot = "define"
3029$ ELSE
3030$ default_inc_excludes_dot = "undef"
3031$ ENDIF
3032$!
97abc6ad
HM
3033$! update makefile here
3034$! echo4 "Updating makefile..."
3035$!
3036$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
3037$ THEN
08c7cbbb
GS
3038$ makefile = "" !wrt MANIFEST dir
3039$ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
3040$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
570bb66e 3041$ Makefile_SH = "descrip_mms.template"
97abc6ad 3042$ ELSE
08c7cbbb
GS
3043$ makefile = " -f Makefile." !wrt MANIFEST dir
3044$ UUmakefile = "[-]Makefile." !wrt CWD dir
3045$ DEFmakefile = "Makefile." !wrt DEF dir (?)
570bb66e 3046$ Makefile_SH = "Makefile.in"
97abc6ad
HM
3047$ ENDIF
3048$!
7558ebc2
PP
3049$ IF macros .NES. ""
3050$ THEN
97abc6ad
HM
3051$ tmp = F$LENGTH(macros)
3052$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
3053$ macros = "/macro=(" + macros + ")"
3054$ ENDIF
498336ed
CB
3055$! Build up the extra C flags
3056$!
7558ebc2
PP
3057$ IF use_ieee_math
3058$ THEN
e0261ef8 3059$ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm"
3ad67d07 3060$ ELSE
2b4b3ebb 3061$ IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
3ad67d07
CB
3062$ THEN
3063$ extra_flags = "''extra_flags'" + "/float=g_float"
3064$ ENDIF
7558ebc2 3065$ ENDIF
1171624b 3066$ names_flags = ""
7558ebc2
PP
3067$ IF be_case_sensitive
3068$ THEN
1171624b 3069$ names_flags = "AS_IS"
7558ebc2 3070$ ENDIF
1171624b
CB
3071$ IF shorten_long_symbols
3072$ THEN
3073$ IF be_case_sensitive
3074$ THEN
3075$ names_flags = "''names_flags',SHORTENED"
3076$ ELSE
3077$ names_flags = "SHORTENED"
3078$ ENDIF
3079$ ENDIF
3080$ IF F$LENGTH(names_flags) .ne. 0
3081$ THEN
3082$ extra_flags = "''extra_flags'" + "/NAMES=(''names_flags')"
3083$ ENDIF
3084$ DELETE/SYMBOLS names_flags
498336ed 3085$ extra_flags = "''extra_flags'" + "''user_c_flags'"
97abc6ad 3086$!
570bb66e
JH
3087$ min_pgflquota = "100000"
3088$ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
3089$ IF pgflquota .LES. min_pgflquota
3090$ THEN
3091$ echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
3092$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
3093$ IF ans
3094$ THEN
3095$ echo4 "Continuing..."
3096$ ELSE
3097$ echo4 "ABORTING..."
3098$ GOTO Clean_up
3099$ ENDIF
3100$ ENDIF
97abc6ad
HM
3101$!
3102$ echo ""
570bb66e
JH
3103$ echo4 "Checking the C run-time library."
3104$!
56aeb0ae 3105$! Former SUBCONFIGURE.COM
570bb66e
JH
3106$!
3107$! - build a config.sh for VMS Perl.
3108$! - use built config.sh to take config_h.SH -> config.h
3109$! - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
3110$! vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
3111$! vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
570bb66e
JH
3112$!
3113$! Note for folks from other platforms changing things in here:
3114$!
3115$! Fancy changes (based on compiler capabilities or VMS version or
3116$! whatever) are tricky, so go ahead and punt on those.
3117$!
3118$! Simple changes, though (say, always setting something to 1, or undef,
3119$! or something like that) are straightforward. Adding a new constant
3120$! item for the ultimately created config.sh requires at least one
3121$! (possibly more) line(s) to this file.
3122$!
3123$! Add a line in the format:
3124$!
3125$! $ WC "foo='undef'"
3126$!
3127$! somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
3128$! and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
3129$! is sorted ASCII and corresponds to the output of config.sh in the
3130$! Bourne shell version of Configure).
3131$! Be very careful with quoting, as it can be tricky.
3132$! For example if instead of a constant string like 'undef' or 'define'
3133$! you wanted to add something to VMS's config.sh that looks like:
3134$!
3135$! blank_string=''
3136$!
3137$! then add a line that looks like this before the
3138$! '##END WRITE NEW CONSTANTS HERE##' tagged line:
3139$!
3140$! $ WC "blank_string='" + "'"
3141$!
3142$! (+ is the string concatenator and "''var'" has the effect
3143$! of "${var}" in perl or sh, but "'const'" is not interpolated).
3144$!
3145$! Note that unitialized variables, such as a line like:
3146$!
3147$! $ WC "new_var='" + new_var + "'"
3148$!
3149$! should be avoided unless new_var has a value assigned prior
3150$! to that line (think of perl's -w warnings).
3151$!
3152$! %DCL-W-UNDSYM, undefined symbol - check validity and spelling
3153$! \NEW_VAR\
3154$!
3155$!
3156$ vms_ver = F$EXTRACT(1,3, osvers)
3157$ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
3158$ MCC = f$edit(mcc, "UPCASE")
3159$ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
414b89cc 3160$ IF ccname .EQS. "DEC"
570bb66e
JH
3161$ THEN
3162$ Checkcc := "''Mcc'/prefix=all"
3163$ ELSE
414b89cc 3164$ IF ccname .EQS. "CXX"
570bb66e
JH
3165$ THEN
3166$ Checkcc := cxx
3167$ ELSE
3168$ Checkcc := "''Mcc'"
3169$ ENDIF
3170$ ENDIF
3171$ ccflags = ccflags + extra_flags
3172$ IF be_case_sensitive
3173$ THEN
3174$ d_vms_be_case_sensitive = "define"
3175$ ELSE
3176$ d_vms_be_case_sensitive = "undef"
3177$ ENDIF
1171624b
CB
3178$ IF shorten_long_symbols
3179$ THEN
3180$ d_vms_shorten_long_symbols = "define"
3181$ ELSE
3182$ d_vms_shorten_long_symbols = "undef"
3183$ ENDIF
570bb66e
JH
3184$! Some constant defaults.
3185$ hwname = f$getsyi("HW_NAME")
3186$ myname = myhostname
3187$ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
3188$!
3189$ ccdlflags=""
3190$ cccdlflags=""
3191$!
50ddda1d
CB
3192$! FIXME -- This section does not really handle all the different permutations
3193$! of 64-bitness, and it does not provide for the /POINTER_SIZE=64 compiler
3194$! option that would be necessary to support the "explicit 64-bit interfaces"
3195$! promised by -Dusemorebits.
3196$!
3197$ usemorebits = "undef"
570bb66e
JH
3198$ IF use64bitint .OR. use64bitint .EQS. "define"
3199$ THEN
3200$ use64bitint = "define"
842bcadf
CB
3201$ ivdformat="""Ld"""
3202$ uvuformat="""Lu"""
3203$ uvoformat="""Lo"""
3204$ uvxformat="""Lx"""
3205$ uvXUformat="""LX"""
570bb66e
JH
3206$ ELSE
3207$ use64bitint = "undef"
842bcadf
CB
3208$ ivdformat="""ld"""
3209$ uvuformat="""lu"""
3210$ uvoformat="""lo"""
3211$ uvxformat="""lx"""
3212$ uvXUformat="""lX"""
3213$ ENDIF
3214$ IF uselongdouble .OR. uselongdouble .EQS. "define"
3215$ THEN
50ddda1d
CB
3216$ uselongdouble = "define"
3217$ alignbytes="16"
842bcadf 3218$ nveformat="""Le"""
d677d0fc 3219$ nvEUformat="""LE"""
842bcadf 3220$ nvfformat="""Lf"""
d677d0fc 3221$ nvFUformat="""LF"""
842bcadf 3222$ nvgformat="""Lg"""
d677d0fc 3223$ nvGUformat="""LG"""
842bcadf 3224$ ELSE
50ddda1d 3225$ uselongdouble = "undef"
842bcadf 3226$ nveformat="""e"""
d677d0fc 3227$ nvEUformat="""E"""
842bcadf 3228$ nvfformat="""f"""
d677d0fc 3229$ nvFUformat="""F"""
842bcadf 3230$ nvgformat="""g"""
d677d0fc 3231$ nvGUformat="""G"""
570bb66e
JH
3232$ ENDIF
3233$ IF use64bitall .OR. use64bitall .EQS. "define"
3234$ THEN
3235$ use64bitall = "define"
3236$ ELSE
3237$ use64bitall = "undef"
3238$ ENDIF
e366167b
CB
3239$ IF uselargefiles .OR. uselargefiles .EQS. "define"
3240$ THEN
3241$ uselargefiles = "define"
3242$ ELSE
3243$ uselargefiles = "undef"
3244$ ENDIF
570bb66e 3245$!
9b5c8979
JH
3246$ usemymalloc = "undef"
3247$ if mymalloc then usemymalloc = "define"
570bb66e
JH
3248$!
3249$ perl_cc=Mcc
3250$!
2b4b3ebb 3251$ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP")
570bb66e
JH
3252$ THEN
3253$ obj_ext=".abj"
3254$ so="axe"
3255$ dlext="axe"
3256$ exe_ext=".axe"
3257$ lib_ext=".alb"
3258$ ELSE
2b4b3ebb 3259$ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_IA64")
a50752f9
CB
3260$ THEN
3261$ obj_ext=".ibj"
3262$ so="ixe"
3263$ dlext="ixe"
3264$ exe_ext=".ixe"
3265$ lib_ext=".ilb"
3266$ ELSE
3267$ obj_ext=".obj"
3268$ so="exe"
3269$ dlext="exe"
3270$ exe_ext=".exe"
3271$ lib_ext=".olb"
3272$ ENDIF
570bb66e
JH
3273$ ENDIF
3274$ dlobj="dl_vms''obj_ext'"
3275$!
1b24ed4b 3276$ cppstdin="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
570bb66e 3277$ cppminus=" "
1b24ed4b 3278$ cpprun="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
570bb66e
JH
3279$ cpplast=" "
3280$!
3281$ timetype="time_t"
3282$ signal_t="void"
3283$ stdchar="char"
3284$!
3285$ IF mymalloc
3286$ THEN d_mymalloc="define"
3287$ ELSE d_mymalloc="undef"
3288$ ENDIF
3289$!
3290$ usedl="define"
ef060a86 3291$ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
4a5365b8 3292$ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
570bb66e 3293$!
32995a38 3294$ libs=" "
c9186d06 3295$ libc="(DECCRTL)"
570bb66e 3296$!
94928b12
JH
3297$! perllibs should be libs with all non-core libs (such as gdbm) removed.
3298$!
3299$ perllibs=libs
3300$!
570bb66e 3301$!
054a3baf
CB
3302$ d_PRId64 = "define"
3303$ d_PRIi64 = "define"
3304$ d_PRIu64 = "define"
3305$ d_PRIo64 = "define"
3306$ d_PRIx64 = "define"
3307$ d_PRIXU64 = "define"
3308$ sPRId64 = """Ld"""
3309$ sPRIXU64 = """LX"""
3310$ sPRIi64 = """Li"""
3311$ sPRIo64 = """Lo"""
3312$ sPRIu64 = """Lu"""
3313$ sPRIx64 = """Lx"""
3314$ d_quad = "define"
3315$ quadtype = "long long"
3316$ uquadtype = "unsigned long long"
3317$ quadkind = "3"
3318$!
3319$ d_frexpl = "define"
3320$ d_ldexpl = "define"
3321$ d_modfl = "define"
3322$ d_modflproto = "define"
570bb66e 3323$!
4cb05021
JH
3324$ d_double_has_inf = "undef"
3325$ d_double_has_nan = "undef"
3326$ d_double_has_negative_zero = "undef"
3327$ d_double_has_subnormals = "undef"
3328$ d_double_style_cray = "undef"
3329$ d_double_style_ibm = "undef"
3330$ d_double_style_ieee = "undef"
3331$ d_double_style_vax = "undef"
3332$ d_long_double_style_ieee = "undef"
3333$ d_long_double_style_ieee_extended = "undef"
3334$ d_long_double_style_ieee_std = "undef"
3335$ d_long_double_style_vax = "undef"
6732c5ab 3336$ IF useieee .OR. useieee .EQS. "define"
a175606a 3337$ THEN
4cb05021
JH
3338$ d_double_has_inf = "define"
3339$ d_double_has_nan = "define"
3340$ d_double_has_negative_zero = "define"
3341$ d_double_has_subnormals = "define"
3342$ d_double_style_ieee = "define"
3343$ IF uselongdouble .OR. uselongdouble .EQS. "define"
3344$ THEN
3345$ d_long_double_style_ieee = "define"
3346$! TODO: will the Intel port have ieee_extended for long doubles?
3347$ d_long_double_style_ieee_std = "define"
3348$ ENDIF
a7ed70b3
JH
3349$ d_acosh = "define"
3350$ d_asinh = "define"
3351$ d_atanh = "define"
3352$ d_cbrt = "define"
3353$ d_copysign = "define"
3354$ d_erf = "define"
3355$ d_erfc = "define"
3356$ d_exp2 = "define"
3357$ d_expm1 = "define"
3358$ d_fdim = "define"
3359$ d_fma = "define"
3360$ d_fmax = "define"
3361$ d_fmin = "define"
3362$ d_fp_classify = "define"
3363$ d_hypot = "define"
3364$ d_ilogb = "define"
a175606a 3365$ d_isnan = "define"
a7ed70b3 3366$ d_isnormal = "define"
4671125a 3367$ d_j0 = "define"
a7ed70b3
JH
3368$ d_lgamma = "define"
3369$ d_log1p = "define"
3370$ d_log2 = "define"
3371$ d_logb = "define"
3372$ d_lrint = "define"
bc580dd3 3373$ d_lrintl = "define"
a7ed70b3 3374$ d_lround = "define"
bc580dd3 3375$ d_lroundl = "define"
a7ed70b3
JH
3376$ d_nextafter = "define"
3377$ d_nexttoward = "define"
3378$ d_remainder = "define"
3379$ d_remquo = "define"
3380$ d_rint = "define"
3381$ d_tgamma = "define"
3382$ d_trunc = "define"
4842dad7 3383$ d_truncl = "define"
a175606a 3384$ ELSE
4cb05021
JH
3385$ d_double_style_vax = "define"
3386$ IF uselongdouble .OR. uselongdouble .EQS. "define"
3387$ THEN
3388$ d_long_double_style_vax = "undef" ! VAX format H unlikely
3389$ ENDIF
3390$ d_acosh = "undef"
a7ed70b3
JH
3391$ d_acosh = "undef"
3392$ d_asinh = "undef"
3393$ d_atanh = "undef"
3394$ d_cbrt = "undef"
3395$ d_copysign = "undef"
3396$ d_erf = "undef"
3397$ d_erfc = "undef"
3398$ d_exp2 = "undef"
3399$ d_expm1 = "undef"
3400$ d_fdim = "undef"
3401$ d_fma = "undef"
3402$ d_fmax = "undef"
3403$ d_fmin = "undef"
3404$ d_fp_classify = "undef"
3405$ d_hypot = "undef"
3406$ d_ilogb = "undef"
a175606a 3407$ d_isnan = "undef"
a7ed70b3 3408$ d_isnormal = "undef"
4671125a 3409$ d_j0 = "undef"
a7ed70b3
JH
3410$ d_lgamma = "undef"
3411$ d_log1p = "undef"
3412$ d_log2 = "undef"
3413$ d_logb = "undef"
3414$ d_lrint = "undef"
bc580dd3 3415$ d_lrintl = "undef"
a7ed70b3 3416$ d_lround = "undef"
bc580dd3 3417$ d_lroundl = "undef"
a7ed70b3
JH
3418$ d_nextafter = "undef"
3419$ d_nexttoward = "undef"
3420$ d_remainder = "undef"
3421$ d_remquo = "undef"
3422$ d_rint = "undef"
3423$ d_tgamma = "undef"
3424$ d_trunc = "undef"
4842dad7 3425$ d_truncl = "undef"
a175606a
CB
3426$ ENDIF
3427$!
570bb66e
JH
3428$! Now some that we build up
3429$!
0f7b1033
CB
3430$ d_old_pthread_create_joinable = "undef"
3431$ old_pthread_create_joinable = " "
a92ae878 3432$ IF use_threads
570bb66e 3433$ THEN
0f7b1033 3434$ useithreads = "define"
570bb66e 3435$ ELSE
570bb66e
JH
3436$ useithreads = "undef"
3437$ ENDIF
3438$!
3439$! Some that we need to invoke the compiler for
3440$!
3441$!
3442$! handy construction aliases/symbols
3443$!
3444$ OS := "open/write CONFIG []try.c"
3445$ WS := "write CONFIG"
3446$ CS := "close CONFIG"
3447$ DS := "delete/nolog/noconfirm []try.*;*"
3448$ Needs_Opt := N
3449$ good_compile = %X10B90001
414b89cc 3450$ IF ccname .EQS. "GCC"
570bb66e
JH
3451$ THEN
3452$ open/write OPTCHAN []try.opt
3453$ write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3454$ write OPTCHAN "Sys$Share:VAXCRTL/Share"
3455$ Close OPTCHAN
3456$ Needs_Opt := Y
3457$ good_compile = %X10000001
3458$ ENDIF
414b89cc 3459$ IF ccname .EQS. "CXX"
570bb66e
JH
3460$ THEN
3461$ good_compile = %X15F60001
3462$ ENDIF
3463$ good_link = %X10000001
3464$ tmp = "" ! null string default
3465$!
3466$ GOTO beyond_compile_ok
3467$!
3468$! Check for type sizes
3469$!
3470$type_size_check:
3471$!
3472$ OS
7558ebc2
PP
3473$ WS "#if defined(__DECC) || defined(__DECCXX)"
3474$ WS "#include <stdlib.h>"
3475$ WS "#endif"
3476$ WS "#include <stdio.h>"
3477$ WS "int main()"
570bb66e
JH
3478$ WS "{"
3479$ WS "printf(""%d\n"", sizeof(''tmp'));"
7558ebc2 3480$ WS "exit(0);"
570bb66e
JH
3481$ WS "}"
3482$ CS
3483$ GOSUB compile
3484$ RETURN
3485$!
3486$!: locate header file
3487$findhdr:
3488$!
3489$ OS
7558ebc2
PP
3490$ WS "#if defined(__DECC) || defined(__DECCXX)"
3491$ WS "#include <stdlib.h>"
3492$ WS "#endif"
3493$ WS "#include <stdio.h>"
570bb66e 3494$ WS "#include <''tmp'>"
7558ebc2 3495$ WS "int main()"
570bb66e
JH
3496$ WS "{"
3497$ WS "printf(""define\n"");"
7558ebc2 3498$ WS "exit(0);"
570bb66e
JH
3499$ WS "}"
3500$ CS
3501$ GOSUB link_ok
3502$ RETURN
3503$!
3504$!: define an alternate in-header-list? function
3505$inhdr:
3506$!
3507$ GOSUB findhdr
3508$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3509$ THEN
3510$ echo4 "<''tmp'> found."
3511$ tmp = "define"
3512$ ELSE
3513$ echo4 "<''tmp'> NOT found."
3514$ tmp = "undef"
3515$ ENDIF
3516$ RETURN
3517$!
3518$!: define an is-in-libc? function
3519$inlibc:
3520$ GOSUB link_ok
3521$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3522$ THEN
3523$ echo4 "''tmp'() found."
3524$ tmp = "define"
3525$ ELSE
3526$ echo4 "''tmp'() NOT found."
3527$ tmp = "undef"
3528$ ENDIF
3529$ RETURN
3530$!
3531$!: define a shorthand compile call
3532$compile:
3533$ GOSUB link_ok
3534$just_mcr_it:
3535$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3536$ THEN
3537$ OPEN/WRITE CONFIG []try.out
3538$ DEFINE/USER_MODE SYS$ERROR CONFIG
3539$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
3540$ MCR []try.exe
3541$ CLOSE CONFIG
3542$ OPEN/READ CONFIG []try.out
3543$ READ CONFIG tmp
3544$ CLOSE CONFIG
3545$ DELETE/NOLOG/NOCONFIRM []try.out;
3546$ DELETE/NOLOG/NOCONFIRM []try.exe;
3547$ ELSE
3548$ tmp = "" ! null string default
3549$ ENDIF
3550$ RETURN
3551$!
3552$link_ok:
3553$ GOSUB compile_ok
3554$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3555$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3556$ SET NOON
3557$ IF Needs_Opt
3558$ THEN
3559$ 'ld' try.obj,try.opt/opt
3560$ link_status = $status
3561$ ELSE
3562$ 'ld' try.obj
3563$ link_status = $status
3564$ ENDIF
3565$ SET ON
3566$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3567$ RETURN
3568$!
3569$!: define a shorthand compile call for compilations that should be ok.
3570$compile_ok:
3571$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3572$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3573$ SET NOON
3574$ 'Checkcc' try.c
3575$ compile_status = $status
3576$ SET ON
3577$ DELETE/NOLOG/NOCONFIRM try.c;
3578$ RETURN
3579$!
3580$beyond_compile_ok:
3581$!
3582$! Check for __STDC__
3583$!
3584$ OS
7558ebc2
PP
3585$ WS "#if defined(__DECC) || defined(__DECCXX)"
3586$ WS "#include <stdlib.h>"
3587$ WS "#endif"
3588$ WS "#include <stdio.h>"
3589$ WS "int main()"
570bb66e 3590$ WS "{"
7558ebc2
PP
3591$ WS "#ifdef __STDC__"
3592$ WS "printf(""42\n"");"
85fac3a9
CB
3593$ WS "#elif defined (__STD_ANSI)" ! for CXX
3594$ WS "printf(""42\n"");"
7558ebc2
PP
3595$ WS "#else"
3596$ WS "printf(""1\n"");"
3597$ WS "#endif"
3598$ WS "exit(0);"
570bb66e
JH
3599$ WS "}"
3600$ CS
3601$ GOSUB compile
3602$ cpp_stuff=tmp
3603$ IF F$INTEGER(tmp) .eq. 42
3604$ THEN
85fac3a9
CB
3605$ echo4 "Oh! Smells like ANSI's been here."
3606$ echo "We can catify or stringify, separately or together!"
570bb66e
JH
3607$ ENDIF
3608$!
3609$! Check for double size
3610$!
3611$ echo4 "Checking to see how big your double precision numbers are..."
3612$ tmp="double"
3613$ GOSUB type_size_check
3614$ doublesize = tmp
3615$ echo "Your double is ''doublesize' bytes long."
3616$!
3617$! Check for long double size
3618$!
3619$ OS
7558ebc2 3620$ WS "#if defined(__DECC) || defined(__DECCXX)"
0e965207 3621$ WS "#pragma message disable ALL" ! VAX compilers may have distracting informationals
7558ebc2
PP
3622$ WS "#include <stdlib.h>"
3623$ WS "#endif"
3624$ WS "#include <stdio.h>"
3625$ WS "int main()"
570bb66e 3626$ WS "{"
7558ebc2
PP
3627$ WS "printf(""%d\n"", sizeof(long double));"
3628$ WS "exit(0);"
570bb66e
JH
3629$ WS "}"
3630$ CS
3631$ echo4 "Checking to see if you have long double..."
3632$ GOSUB link_ok
3633$ IF link_status .NE. good_link
3634$ THEN
3635$ longdblsize="0"
aea4e42b 3636$ longdblkind="0"
44521f3a
JH
3637$ longdblinfbytes="undef"
3638$ longdblnanbytes="undef"
ed3917fd 3639$ longdblmantbits="undef"
570bb66e
JH
3640$ d_longdbl="undef"
3641$ echo "You do not have long double."
3642$ ELSE
3643$ echo "You have long double."
3644$ echo4 "Checking to see how big your long doubles are..."
3645$ GOSUB just_mcr_it
3646$ longdblsize = tmp
dc91db6c 3647$ longdblkind = "1"
44521f3a
JH
3648$ longdblinfbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0x7f"
3649$ longdblnanbytes="0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff"
ed3917fd 3650$ longdblmantbits="112"
570bb66e
JH
3651$ d_longdbl = "define"
3652$ echo "Your long doubles are ''longdblsize' bytes long."
3653$ ENDIF
3654$!
7f830b7b
CB
3655$ IF d_longdbl .OR. d_longdbl .EQS. "define"
3656$ THEN
3657$ d_PRIEUldbl = "define"
3658$ d_PRIFUldbl = "define"
3659$ d_PRIGUldbl = "define"
3660$ d_PRIeldbl = "define"
3661$ d_PRIfldbl = "define"
3662$ d_PRIgldbl = "define"
3663$ sPRIEUldbl = """LE"""
3664$ sPRIFUldbl = """LF"""
3665$ sPRIGUldbl = """LG"""
3666$ sPRIeldbl = """Le"""
3667$ sPRIfldbl = """Lf"""
3668$ sPRIgldbl = """Lg"""
3669$ ELSE
3670$ d_PRIEUldbl = "undef"
3671$ d_PRIFUldbl = "undef"
3672$ d_PRIGUldbl = "undef"
3673$ d_PRIeldbl = "undef"
3674$ d_PRIfldbl = "undef"
3675$ d_PRIgldbl = "undef"
3676$ sPRIEUldbl = ""
3677$ sPRIFUldbl = ""
3678$ sPRIGUldbl = ""
3679$ sPRIeldbl = ""
3680$ sPRIfldbl = ""
3681$ sPRIgldbl = ""
3682$ ENDIF
3683$ d_SCNfldbl = d_PRIfldbl
3684$ sSCNfldbl = sPRIfldbl ! expect consistency
3685$!
570bb66e
JH
3686$!: check for long long
3687$ OS
7558ebc2
PP
3688$ WS "#if defined(__DECC) || defined(__DECCXX)"
3689$ WS "#include <stdlib.h>"
3690$ WS "#endif"
3691$ WS "#include <stdio.h>"
3692$ WS "int main()"
570bb66e 3693$ WS "{"
7558ebc2
PP
3694$ WS "printf(""%d\n"", sizeof(long long));"
3695$ WS "exit(0);"
570bb66e
JH
3696$ WS "}"
3697$ CS
3698$ echo4 "Checking to see if you have long long..."
3699$ GOSUB link_ok
3700$ IF link_status .NE. good_link
3701$ THEN
3702$ longlongsize="0"
3703$ d_longlong="undef"
3704$ echo "You do not have long long."
3705$ ELSE
3706$ echo "You have long long."
3707$ echo4 "Checking to see how big your long longs are..."
3708$ GOSUB just_mcr_it
3709$ longlongsize = tmp
3710$ d_longlong = "define"
3711$ echo "Your long longs are ''longlongsize' bytes long."
3712$ ENDIF
3713$!
3714$! Check the prototype for getgid
3715$!
3716$ echo "Looking for the type for group ids returned by getgid()."
3717$ OS
7558ebc2
PP
3718$ WS "#if defined(__DECC) || defined(__DECCXX)"
3719$ WS "#include <stdlib.h>"
3720$ WS "#endif"
3721$ WS "#include <stdio.h>"
3722$ WS "#include <types.h>"
3723$ WS "int main()"
570bb66e 3724$ WS "{"
7558ebc2
PP
3725$ WS "gid_t foo;"
3726$ WS "exit(0);"
570bb66e
JH
3727$ WS "}"
3728$ CS
3729$ GOSUB compile_ok
3730$ IF compile_status .NE. good_compile
3731$ THEN
3732$! Okay, gid_t failed. Must be unsigned int
3733$ gidtype = "unsigned int"
3734$ echo4 "assuming ""''gidtype'""."
3735$ ELSE
3736$ gidtype = "gid_t"
3737$ echo4 "gid_t found."
3738$ ENDIF
3739$!
3740$! Check to see if we've got dev_t
3741$!
3742$ echo "Looking for the type for dev."
3743$ OS
7558ebc2
PP
3744$ WS "#if defined(__DECC) || defined(__DECCXX)"
3745$ WS "#include <stdlib.h>"
3746$ WS "#endif"
3747$ WS "#include <stdio.h>"
3748$ WS "#include <types.h>"
3749$ WS "int main()"
570bb66e 3750$ WS "{"
7558ebc2
PP
3751$ WS "dev_t foo;"
3752$ WS "exit(0);"
570bb66e
JH
3753$ WS "}"
3754$ CS
3755$ GOSUB compile_ok
3756$ IF compile_status .NE. good_compile
3757$ THEN
3758$! Okay, dev_t failed. Must be unsigned int
3759$ devtype = "unsigned int"
3760$ echo4 "assuming ""''devtype'""."
3761$ ELSE
3762$ devtype = "dev_t"
3763$ echo4 "dev_t found."
3764$ ENDIF
3765$!
3766$! Check to see if we've got unistd.h (which we ought to, but you never know)
3767$!
3768$ i_netdb = "undef"
3769$ tmp = "unistd.h"
3770$ GOSUB inhdr
3771$ i_unistd = tmp
3772$!
704c2eb3
JM
3773$! Check to see if we've got utime.h (which we should use if we have)
3774$!
3775$ i_netdb = "undef"
3776$ tmp = "utime.h"
3777$ GOSUB inhdr
3778$ i_utime = tmp
3779$!
41cbbefa
CB
3780$! do we have getppid()?
3781$!
3782$ IF i_unistd .EQS. "define"
3783$ THEN
3784$ OS
3785$ WS "#include <stdio.h>"
3786$ WS "#include <unistd.h>"
3787$ WS "int main() {"
3788$ WS "printf(""%d\n"",getppid());"
3789$ WS "return(0);"
3790$ WS "}"
3791$ CS
3792$ tmp = "getppid"
3793$ GOSUB inlibc
3794$ d_getppid = tmp
3795$ ELSE
3796$ d_getppid = "undef"
3797$ ENDIF
3798$!
570bb66e
JH
3799$!: see if this is a libutil.h system
3800$!
3801$ tmp = "libutil.h"
3802$ GOSUB inhdr
3803$ i_libutil = tmp
3804$!
3805$! Check to see if we've got shadow.h (probably not, but...)
3806$!
3807$ tmp = "shadow.h"
3808$ GOSUB inhdr
3809$ i_shadow = tmp
3810$!
3811$! Check to see if we've got socks.h (probably not, but...)
3812$!
3813$ tmp = "socks.h"
3814$ GOSUB inhdr
3815$ i_socks = tmp
3816$!
3817$! Check the prototype for select
3818$!
046cc26c 3819$ IF Has_Dec_C_Sockets
570bb66e
JH
3820$ THEN
3821$ OS
7558ebc2
PP
3822$ WS "#if defined(__DECC) || defined(__DECCXX)"
3823$ WS "#include <stdlib.h>"
3824$ WS "#endif"
3825$ WS "#include <stdio.h>"
3826$ WS "#include <types.h>"
3827$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
046cc26c
CB
3828$ WS "#include <time.h>"
3829$ WS "#include <socket.h>"
7558ebc2 3830$ WS "int main()"
570bb66e 3831$ WS "{"
7558ebc2
PP
3832$ WS "fd_set *foo;"
3833$ WS "int bar;"
3834$ WS "foo = NULL;"
3835$ WS "bar = select(2, foo, foo, foo, NULL);"
3836$ WS "exit(0);"
570bb66e
JH
3837$ WS "}"
3838$ CS
3839$ GOSUB compile_ok
3840$ IF compile_status .NE. good_compile
3841$ THEN
3842$! Okay, select failed. Must be an int *
3843$ selecttype = "int *"
3844$ echo4 "select() NOT found."
3845$ ELSE
3846$ selecttype="fd_set *"
3847$ echo4 "select() found."
3848$ ENDIF
3849$ ELSE
3850$ ! No sockets, so stick in an int * : no select, so pick a harmless default
3851$ selecttype = "int *"
3852$ ENDIF
3853$!
3854$! Check to see if fd_set exists
3855$!
3856$ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3857$ OS
7558ebc2
PP
3858$ WS "#if defined(__DECC) || defined(__DECCXX)"
3859$ WS "#include <stdlib.h>"
3860$ WS "#endif"
3861$ WS "#include <stdio.h>"
3862$ WS "#include <types.h>"
570bb66e
JH
3863$ IF Has_Dec_C_Sockets
3864$ THEN
7558ebc2
PP
3865$ WS "#include <time.h>"
3866$ WS "#include <socket.h>"
570bb66e 3867$ ENDIF
7558ebc2 3868$ WS "int main()"
570bb66e 3869$ WS "{"
7558ebc2
PP
3870$ WS "fd_set *foo;"
3871$ WS "int bar;"
3872$ WS "exit(0);"
570bb66e
JH
3873$ WS "}"
3874$ CS
3875$ GOSUB compile_ok
3876$ IF compile_status .ne. good_compile
3877$ THEN
3878$! Okay, fd_set failed. Must not exist
3879$ d_fd_set = "undef"
3880$ echo4 "Hmm, your compiler has some difficulty with fd_set."
3881$ ELSE
3882$ d_fd_set="define"
3883$ echo4 "Well, your system knows about the normal fd_set typedef..."
3884$ ENDIF
3885$!
6568ef82
CB
3886$! Check for stdint.h
3887$!
3888$ tmp = "stdint.h"
3889$ GOSUB inhdr
3890$ i_stdint = tmp
3891$!
570bb66e
JH
3892$! Check for inttypes.h
3893$!
3894$ tmp = "inttypes.h"
3895$ GOSUB inhdr
3896$ i_inttypes = tmp
3897$!
3898$! Check to see if off64_t exists
3899$!
3900$ echo4 "Checking to see if you have off64_t..."
3901$ OS
7558ebc2
PP
3902$ WS "#if defined(__DECC) || defined(__DECCXX)"
3903$ WS "#include <stdlib.h>"
3904$ WS "#endif"
3905$ WS "#include <stdio.h>"
3906$ WS "#include <types.h>"
3907$ WS "#''i_inttypes' IIH"
3908$ WS "#ifdef IIH"
3909$ WS "#include <inttypes.h>"
3910$ WS "#endif"
3911$ WS "int main()"
570bb66e 3912$ WS "{"
7558ebc2
PP
3913$ WS "off64_t bar;"
3914$ WS "exit(0);"
570bb66e
JH
3915$ WS "}"
3916$ CS
3917$ GOSUB compile_ok
3918$ IF compile_status .EQ. good_compile
3919$ THEN
3920$ d_off64_t="define"
3921$ echo "You have off64_t."
3922$ ELSE
3923$ d_off64_t = "undef"
3924$ echo "You do not have off64_t."
3925$ ENDIF
3926$!
6568ef82
CB
3927$! Check to see if fpclassify exists
3928$!
3929$ OS
3930$ WS "#if defined(__DECC) || defined(__DECCXX)"
3931$ WS "#include <stdlib.h>"
3932$ WS "#endif"
3933$ WS "#include <math.h>"
3934$ WS "int main()"
3935$ WS "{"
3936$ WS "if (fpclassify(0.0) == FP_ZERO) exit(0);"
3937$ WS "exit(1);"
3938$ WS "}"
3939$ CS
3940$ tmp = "fpclassify"
3941$ GOSUB inlibc
3942$ d_fpclassify = tmp
3943$!
570bb66e
JH
3944$! Check to see if fpos64_t exists
3945$!
3946$ echo4 "Checking to see if you have fpos64_t..."
3947$ OS
7558ebc2
PP
3948$ WS "#if defined(__DECC) || defined(__DECCXX)"
3949$ WS "#include <stdlib.h>"
3950$ WS "#endif"
3951$ WS "#include <stdio.h>"
3952$ WS "#include <types.h>"
3953$ WS "#''i_inttypes' IIH"
3954$ WS "#ifdef IIH"
3955$ WS "#include <inttypes.h>"
3956$ WS "#endif"
3957$ WS "int main()"
570bb66e 3958$ WS "{"
7558ebc2
PP
3959$ WS "fpos64_t bar;"
3960$ WS "exit(0);"
570bb66e
JH
3961$ WS "}"
3962$ CS
3963$ GOSUB compile_ok
3964$ IF compile_status .EQ. good_compile
3965$ THEN
3966$ d_fpos64_t="define"
3967$ echo "You have fpos64_t."
3968$ ELSE
3969$ d_fpos64_t = "undef"
3970$ echo "You do not have fpos64_t."
3971$ ENDIF
3972$!
3973$! Check to see if int64_t exists
3974$!
3975$ echo4 "Checking to see if you have int64_t..."
3976$ OS
7558ebc2
PP
3977$ WS "#if defined(__DECC) || defined(__DECCXX)"
3978$ WS "#include <stdlib.h>"
3979$ WS "#endif"
3980$ WS "#include <stdio.h>"
3981$ WS "#include <types.h>"
3982$ WS "#''i_inttypes' IIH"
3983$ WS "#ifdef IIH"
3984$ WS "#include <inttypes.h>"
3985$ WS "#endif"
3986$ WS "int main()"
570bb66e 3987$ WS "{"
7558ebc2
PP
3988$ WS "int64_t bar;"
3989$ WS "exit(0);"
570bb66e
JH
3990$ WS "}"
3991$ CS
3992$ GOSUB compile_ok
3993$ IF compile_status .EQ. good_compile
3994$ THEN
3995$ d_int64_t="define"
3996$ echo "You have int64_t."
3997$ ELSE
3998$ d_int64_t = "undef"
3999$ echo "You do not have int64_t."
4000$ ENDIF
4001$!
e0261ef8
CB
4002$! Check to see if fseeko exists
4003$!
4004$ OS
4005$ WS "#include <stdio.h>"
4006$ WS "int main()"
4007$ WS "{"
4008$ WS "FILE *f=NULL;"
4009$ WS "fseeko(f,(off_t)0,SEEK_SET);"
4010$ WS "return(0);"
4011$ WS "}"
4012$ CS
4013$ tmp = "fseeko"
4014$ GOSUB inlibc
4015$ d_fseeko = tmp
4016$!
4017$! Check to see if ftello exists
4018$!
4019$ OS
4020$ WS "#include <stdio.h>"
4021$ WS "int main()"
4022$ WS "{"
4023$ WS "FILE *f=NULL; off_t o=0;"
4024$ WS "o=ftello(f);"
4025$ WS "return(0);"
4026$ WS "}"
4027$ CS
4028$ tmp = "ftello"
4029$ GOSUB inlibc
4030$ d_ftello = tmp
4031$!
570bb66e
JH
4032$!: see if this is a netdb.h system
4033$ IF Has_Dec_C_Sockets
4034$ THEN
4035$ tmp = "netdb.h"
4036$ GOSUB inhdr
4037$ i_netdb = tmp
4038$ ENDIF
4039$!
4040$! Check for h_errno
4041$!
4042$ echo4 "Checking to see if you have h_errno..."
4043$ OS
7558ebc2
PP
4044$ WS "#if defined(__DECC) || defined(__DECCXX)"
4045$ WS "#include <stdlib.h>"
4046$ WS "#endif"
4047$ WS "#include <stdio.h>"
4048$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
4049$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4050$ WS "int main()"
570bb66e 4051$ WS "{"
7558ebc2
PP
4052$ WS "h_errno = 3;"
4053$ WS "exit(0);"
570bb66e
JH
4054$ WS "}"
4055$ CS
4056$ GOSUB link_ok
4057$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4058$ THEN
4059$ d_herrno="define"
4060$ echo "You have h_errno."
4061$ ELSE
4062$ d_herrno="undef"
4063$ echo "You do not have h_errno."
4064$ ENDIF
4065$!
4066$! Check to see if gethostname exists
4067$!
046cc26c 4068$ IF Has_Dec_C_Sockets
570bb66e
JH
4069$ THEN
4070$ OS
7558ebc2
PP
4071$ WS "#if defined(__DECC) || defined(__DECCXX)"
4072$ WS "#include <stdlib.h>"
4073$ WS "#endif"
4074$ WS "#include <stdio.h>"
4075$ WS "#include <types.h>"
046cc26c
CB
4076$ WS "#include <time.h>"
4077$ WS "#include <socket.h>"
7558ebc2 4078$ WS "int main()"
570bb66e 4079$ WS "{"
7558ebc2
PP
4080$ WS "char name[100];"
4081$ WS "int bar, baz;"
4082$ WS "bar = 100;"
4083$ WS "baz = gethostname(name, bar);"
4084$ WS "exit(0);"
570bb66e
JH
4085$ WS "}"
4086$ CS
4087$ GOSUB link_ok
4088$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4089$ THEN
4090$ d_gethname="define"
4091$ echo4 "gethostname() found."
4092$ ELSE
4093$ d_gethname="undef"
4094$ ENDIF
4095$ ELSE
4096$ ! No sockets, so no gethname
4097$ d_gethname = "undef"
4098$ ENDIF
4099$!
4100$! Check for sys/file.h
4101$!
4102$ tmp = "sys/file.h"
4103$ GOSUB inhdr
4104$ i_sysfile = tmp
4105$!
670137c2
CB
4106$!
4107$! Check for sys/ioctl.h
4108$!
4109$ tmp = "sys/ioctl.h"
4110$ GOSUB inhdr
4111$ i_sysioctl = tmp
4112$!
570bb66e
JH
4113$! Check for sys/utsname.h
4114$!
4115$ tmp = "sys/utsname.h"
4116$ GOSUB inhdr
4117$ i_sysutsname = tmp
4118$!
4119$! Check for syslog.h
4120$!
4121$ tmp = "syslog.h"
4122$ GOSUB inhdr
4123$ i_syslog = tmp
4124$!
4125$! Check for poll.h
4126$!
4127$ tmp = "poll.h"
4128$ GOSUB inhdr
4129$ i_poll = tmp
4130$!
4131$! Check for sys/uio.h
4132$!
4133$ tmp = "sys/uio.h"
4134$ GOSUB inhdr
4135$ i_sysuio = tmp
4136$!
4137$! Check for sys/mode.h
4138$!
4139$ tmp = "sys/mode.h"
4140$ GOSUB inhdr
4141$ i_sysmode = tmp
4142$!
ed1b9de0
JM
4143$! Check for poll.h
4144$!
4145$ tmp = "sys/poll.h"
4146$ gosub inhdr
4147$ i_syspoll = tmp
4148$!
570bb66e
JH
4149$! Check for sys/access.h
4150$!
4151$ tmp = "sys/access.h"
4152$ GOSUB inhdr
4153$ i_sysaccess = tmp
4154$!
4155$! Check for sys/security.h
4156$!
4157$ tmp = "sys/security.h"
4158$ GOSUB inhdr
4159$ i_syssecrt = tmp
4160$!
4161$! Check for fcntl.h
4162$!
4163$ tmp = "fcntl.h"
4164$ GOSUB inhdr
4165$ i_fcntl = tmp
4166$!
4167$! Check for fcntl
4168$!
4169$ OS
7558ebc2
PP
4170$ WS "#if defined(__DECC) || defined(__DECCXX)"
4171$ WS "#include <stdlib.h>"
4172$ WS "#endif"
4173$ WS "#include <stdio.h>"
4174$ WS "#include <fcntl.h>"
4175$ WS "int main()"
570bb66e 4176$ WS "{"
7558ebc2
PP
4177$ WS "fcntl(1,2,3);"
4178$ WS "exit(0);"
570bb66e
JH
4179$ WS "}"
4180$ CS
4181$ tmp = "fcntl"
4182$ GOSUB inlibc
4183$ d_fcntl = tmp
4184$!
c44c4826
CB
4185$! Check for fcntl locking capability
4186$!
4187$ echo4 "Checking if fcntl-based file locking works... "
4188$ tmp = "undef"
4189$ IF d_fcntl .EQS. "define"
4190$ THEN
4191$ OS
4192$ WS "#include <stdio.h>"
4193$ WS "#if defined(__DECC) || defined(__DECCXX)"
4194$ WS "#include <stdlib.h>"
4195$ WS "#endif"
4196$ WS "#include <fcntl.h>"
4197$ WS "#include <unistd.h>"
4198$ WS "int main() {"
4199$ WS "#if defined(F_SETLK) && defined(F_SETLKW)"
4200$ WS " struct flock flock;"
4201$ WS " int retval, fd;"
5b36ee83 4202$ WS " fd = open(""[-]perl.c"", O_RDONLY);"
c44c4826
CB
4203$ WS " flock.l_type = F_RDLCK;"
4204$ WS " flock.l_whence = SEEK_SET;"
4205$ WS " flock.l_start = flock.l_len = 0;"
4206$ WS " retval = fcntl(fd, F_SETLK, &flock);"
4207$ WS " close(fd);"
4208$ WS " (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
4209$ WS "#else"
4210$ WS " printf(""undef\n"");"
4211$ WS "#endif"
4212$ WS "}"
4213$ CS
4214$ GOSUB link_ok
4215$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4216$ THEN
4217$ GOSUB just_mcr_it
4218$ IF tmp .EQS. "define"
4219$ THEN
4220$ echo4 "Yes, it seems to work."
4221$ ELSE
4222$ echo4 "Nope, it didn't work."
4223$ ENDIF
4224$ ELSE
4225$ echo4 "I'm unable to compile the test program, so I'll assume not."
4226$ tmp = "undef"
4227$ ENDIF
4228$ ELSE
4229$ echo4 "Nope, since you don't even have fcntl()."
4230$ ENDIF
4231$ d_fcntl_can_lock = tmp
4232$!
6568ef82
CB
4233$! Check to see if isblank exists
4234$!
4235$ OS
4236$ WS "#include <stdlib.h>"
4237$ WS "#include <ctype.h>"
4238$ WS "int main()"
4239$ WS "{"
4240$ WS "int c = ' ';"
4241$ WS "if(isblank(c))"
4242$ WS " exit(EXIT_SUCCESS);"
4243$ WS "else"
4244$ WS " exit(EXIT_FAILURE);"
4245$ WS "}"
4246$ CS
4247$ tmp = "isblank"
4248$ GOSUB inlibc
4249$ d_isblank = tmp
4250$!
4251$! Check to see if isless exists
4252$!
4253$ OS
4254$ WS "#include <stdlib.h>"
4255$ WS "#include <math.h>"
4256$ WS "int main() { return isless(1.0, 2.0) ? EXIT_SUCCESS : EXIT_FAILURE; }"
4257$ CS
4258$ tmp = "isless"
4259$ GOSUB inlibc
4260$ d_isless = tmp
4261$!
4262$! Check to see if pre-C99 isnanl exists
4263$!
4264$ OS
4265$ WS "#include <stdlib.h>"
4266$ WS "#include <math.h>"
4267$ WS "int main()"
4268$ WS "{"
4269$ WS " long double x = NaN;
4270$ WS " return isnanl(x) ? EXIT_SUCCESS : EXIT_FAILURE;
4271$ WS "}"
4272$ CS
4273$ tmp = "isnanl"
4274$ GOSUB inlibc
4275$ d_isnanl = tmp
4276$!
4277$! Check to see if llrint exists
4278$!
4279$ OS
4280$ WS "#include <stdlib.h>"
4281$ WS "#include <math.h>"
4282$ WS "int main()"
4283$ WS "{"
4284$ WS " long long x = llrint(1.5);
4285$ WS " return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4286$ WS "}"
4287$ CS
4288$ tmp = "llrint"
4289$ GOSUB inlibc
4290$ d_llrint = tmp
4291$!
4292$! Check to see if llrintl exists
4293$!
4294$ OS
4295$ WS "#include <stdlib.h>"
4296$ WS "#include <math.h>"
4297$ WS "int main()"
4298$ WS "{"
4299$ WS " long long x = llrintl(1.5);
4300$ WS " return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4301$ WS "}"
4302$ CS
4303$ tmp = "llrintl"
4304$ GOSUB inlibc
4305$ d_llrintl = tmp
4306$!
4307$! Check to see if llround exists
4308$!
4309$ OS
4310$ WS "#include <stdlib.h>"
4311$ WS "#include <math.h>"
4312$ WS "int main()"
4313$ WS "{"
4314$ WS " long long x = llround(1.5);
4315$ WS " return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4316$ WS "}"
4317$ CS
4318$ tmp = "llround"
4319$ GOSUB inlibc
4320$ d_llround = tmp
4321$!
4322$! Check to see if llroundl exists
4323$!
4324$ OS
4325$ WS "#include <stdlib.h>"
4326$ WS "#include <math.h>"
4327$ WS "int main()"
4328$ WS "{"
4329$ WS " long long x = llroundl(1.5);
4330$ WS " return x == 2 ? EXIT_SUCCESS : EXIT_FAILURE;
4331$ WS "}"
4332$ CS
4333$ tmp = "llroundl"
4334$ GOSUB inlibc
4335$ d_llroundl = tmp
4336$!
4337$! Check to see if nearbyint exists
4338$!
4339$ OS
4340$ WS "#include <stdlib.h>"
4341$ WS "#include <math.h>"
4342$ WS "int main()"
4343$ WS "{"
4344$ WS " double x = llroundl(1.5);
4345$ WS " return x == 2.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4346$ WS "}"
4347$ CS
4348$ tmp = "nearbyint"
4349$ GOSUB inlibc
4350$ d_nearbyint = tmp
4351$!
4352$! Check to see if round exists
4353$!
4354$ OS
4355$ WS "#include <stdlib.h>"
4356$ WS "#include <math.h>"
4357$ WS "int main()"
4358$ WS "{"
4359$ WS " double x = round(1.5);
4360$ WS " return x == 2.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4361$ WS "}"
4362$ CS
4363$ tmp = "round"
4364$ GOSUB inlibc
4365$ d_round = tmp
4366$!
4367$! Check to see if scalbn exists
4368$!
4369$ OS
4370$ WS "#include <stdlib.h>"
4371$ WS "#include <math.h>"
4372$ WS "int main()"
4373$ WS "{"
4374$ WS " double x = scalbn(1.0, 3);
4375$ WS " return x == 8.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4376$ WS "}"
4377$ CS
4378$ tmp = "scalbn"
4379$ GOSUB inlibc
4380$ d_scalbn = tmp
4381$!
4382$! Check to see if scalbnl exists
4383$!
4384$ OS
4385$ WS "#include <stdlib.h>"
4386$ WS "#include <math.h>"
4387$ WS "int main()"
4388$ WS "{"
4389$ WS " long double x = scalbn(1.0, 3);
4390$ WS " return x == 8.0 ? EXIT_SUCCESS : EXIT_FAILURE;
4391$ WS "}"
4392$ CS
4393$ tmp = "scalbnl"
4394$ GOSUB inlibc
4395$ d_scalbnl = tmp
4396$!
4ff4a40a
MB
4397$! Check for memrchr
4398$!
4399$ OS
4400$ WS "#if defined(__DECC) || defined(__DECCXX)"
4401$ WS "#include <stdlib.h>"
4402$ WS "#endif"
4403$ WS "#include <string.h>"
4404$ WS "int main()"
4405$ WS "{"
4406$ WS "char * place;"
4407$ WS "place = (char *)memrchr(""foo"", 47, 3);"
4408$ WS "exit(0);"
4409$ WS "}"
4410$ CS
4411$ tmp = "memrchr"
4412$ GOSUB inlibc
4413$ d_memrchr = tmp
4414$!
b961752c
DIM
4415$! Check for strnlen
4416$!
4417$ OS
4418$ WS "#if defined(__DECC) || defined(__DECCXX)"
4419$ WS "#include <stdlib.h>"
4420$ WS "#endif"
4421$ WS "#include <string.h>"
4422$ WS "int main()"
4423$ WS "{"
4424$ WS "size_t len;"
4425$ WS "len = strnlen(""foot"", 3);"
4426$ WS "exit(0);"
4427$ WS "}"
4428$ CS
4429$ tmp = "strnlen"
4430$ GOSUB inlibc
4431$ d_strnlen = tmp
4432$!
570bb66e
JH
4433$! Check for strtoull
4434$!
4435$ OS
7558ebc2
PP
4436$ WS "#if defined(__DECC) || defined(__DECCXX)"
4437$ WS "#include <stdlib.h>"
4438$ WS "#endif"
4439$ WS "#include <string.h>"
4440$ WS "int main()"
570bb66e 4441$ WS "{"
7558ebc2
PP
4442$ WS "unsigned __int64 result;"
4443$ WS "result = strtoull(""123123"", NULL, 10);"
4444$ WS "exit(0);"
570bb66e
JH
4445$ WS "}"
4446$ CS
4447$ tmp = "strtoull"
4448$ GOSUB inlibc
4449$ d_strtoull = tmp
4450$!
4451$! Check for strtouq
4452$!
4453$ OS
7558ebc2
PP
4454$ WS "#if defined(__DECC) || defined(__DECCXX)"
4455$ WS "#include <stdlib.h>"
4456$ WS "#endif"
4457$ WS "#include <string.h>"
4458$ WS "int main()"
570bb66e 4459$ WS "{"
7558ebc2
PP
4460$ WS "unsigned __int64 result;"
4461$ WS "result = strtouq(""123123"", NULL, 10);"
4462$ WS "exit(0);"
570bb66e
JH
4463$ WS "}"
4464$ CS
4465$ tmp = "strtouq"
4466$ GOSUB inlibc
4467$ d_strtouq = tmp
4468$!
4469$! Check for strtoll
4470$!
4471$ OS
7558ebc2
PP
4472$ WS "#if defined(__DECC) || defined(__DECCXX)"
4473$ WS "#include <stdlib.h>"
4474$ WS "#endif"
4475$ WS "#include <string.h>"
4476$ WS "int main()"
570bb66e 4477$ WS "{"
7558ebc2
PP
4478$ WS "__int64 result;"
4479$ WS "result = strtoll(""123123"", NULL, 10);"
4480$ WS "exit(0);"
570bb66e
JH
4481$ WS "}"
4482$ CS
4483$ tmp = "strtoll"
4484$ GOSUB inlibc
4485$ d_strtoll = tmp
4486$!
d0e6d399
NC
4487$! Check for strtoq
4488$!
4489$ OS
4490$ WS "#if defined(__DECC) || defined(__DECCXX)"
4491$ WS "#include <stdlib.h>"
28e5dec8
JH
4492$ WS "#endif"
4493$ WS "#include <string.h>"
4494$ WS "int main()"
4495$ WS "{"
4496$ WS "__int64 result;"
4497$ WS "result = strtoq(""123123"", NULL, 10);"
4498$ WS "exit(0);"
4499$ WS "}"
4500$ CS
4501$ tmp = "strtoq"
4502$ GOSUB inlibc
4503$ d_strtoq = tmp
4504$!
570bb66e
JH
4505$! Check for strtold
4506$!
4507$ OS
7558ebc2
PP
4508$ WS "#if defined(__DECC) || defined(__DECCXX)"
4509$ WS "#include <stdlib.h>"
4510$ WS "#endif"
4511$ WS "#include <string.h>"
4512$ WS "int main()"
570bb66e 4513$ WS "{"
7558ebc2 4514$ WS "long double result;"
6568ef82 4515$ WS "result = strtold(""123123"", NULL);"
7558ebc2 4516$ WS "exit(0);"
570bb66e
JH
4517$ WS "}"
4518$ CS
4519$ tmp = "strtold"
4520$ GOSUB inlibc
4521$ d_strtold = tmp
4522$!
4523$! Check for atoll
4524$!
4525$ OS
7558ebc2
PP
4526$ WS "#if defined(__DECC) || defined(__DECCXX)"
4527$ WS "#include <stdlib.h>"
4528$ WS "#endif"
4529$ WS "#include <string.h>"
4530$ WS "int main()"
570bb66e 4531$ WS "{"
7558ebc2
PP
4532$ WS " __int64 result;"
4533$ WS "result = atoll(""123123"");"
4534$ WS "exit(0);"
570bb66e
JH
4535$ WS "}"
4536$ CS
4537$ tmp = "atoll"
4538$ GOSUB inlibc
4539$ d_atoll = tmp
4540$!
4541$! Check for atolf
4542$!
4543$ OS
7558ebc2
PP
4544$ WS "#if defined(__DECC) || defined(__DECCXX)"
4545$ WS "#include <stdlib.h>"
4546$ WS "#endif"
4547$ WS "#include <string.h>"
4548$ WS "int main()"
570bb66e 4549$ WS "{"
7558ebc2
PP
4550$ WS "long double"
4551$ WS "result = atolf(""123123"");"
4552$ WS "exit(0);"
570bb66e
JH
4553$ WS "}"
4554$ CS
4555$ tmp = "atolf"
4556$ GOSUB inlibc
4557$ d_atolf = tmp
4558$!
4559$! Check for access
4560$!
4561$ OS
7558ebc2
PP
4562$ WS "#if defined(__DECC) || defined(__DECCXX)"
4563$ WS "#include <stdlib.h>"
4564$ WS "#endif"
4565$ WS "#include <stdio.h>"
4566$ WS "int main()"
570bb66e 4567$ WS "{"
7558ebc2
PP
4568$ WS "access(""foo"", F_OK);"
4569$ WS "exit(0);"
570bb66e
JH
4570$ WS "}"
4571$ CS
4572$ tmp = "acess"
4573$ GOSUB inlibc
4574$ d_access = tmp
4575$!
570bb66e
JH
4576$! Check for mkstemp
4577$!
4578$ OS
7558ebc2
PP
4579$ WS "#if defined(__DECC) || defined(__DECCXX)"
4580$ WS "#include <stdlib.h>"
4581$ WS "#endif"
4582$ WS "#include <stdio.h>"
4583$ WS "int main()"
570bb66e 4584$ WS "{"
7558ebc2
PP
4585$ WS "mkstemp(""foo"");"
4586$ WS "exit(0);"
570bb66e
JH
4587$ WS "}"
4588$ CS
4589$ tmp = "mkstemp"
4590$ GOSUB inlibc
4591$ d_mkstemp = tmp
4592$!
4593$! Check for mkstemps
4594$!
4595$ OS
7558ebc2
PP
4596$ WS "#if defined(__DECC) || defined(__DECCXX)"
4597$ WS "#include <stdlib.h>"
4598$ WS "#endif"
4599$ WS "#include <stdio.h>"
4600$ WS "int main()"
570bb66e 4601$ WS "{"
7558ebc2
PP
4602$ WS "mkstemps(""foo"", 1);"
4603$ WS "exit(0);"
570bb66e
JH
4604$ WS "}"
4605$ CS
4606$ tmp = "mkstemps"
4607$ GOSUB inlibc
4608$ d_mkstemps = tmp
4609$!
570bb66e
JH
4610$! Check for mkdtemp
4611$!
4612$ OS
7558ebc2
PP
4613$ WS "#if defined(__DECC) || defined(__DECCXX)"
4614$ WS "#include <stdlib.h>"
4615$ WS "#endif"
4616$ WS "#include <stdio.h>"
4617$ WS "int main()"
570bb66e 4618$ WS "{"
7558ebc2
PP
4619$ WS "mkdtemp(""foo"");"
4620$ WS "exit(0);"
570bb66e
JH
4621$ WS "}"
4622$ CS
4623$ tmp = "mkdtemp"
4624$ GOSUB inlibc
4625$ d_mkdtemp = tmp
4626$!
d2d53deb
CB
4627$! Check for poll
4628$!
4629$ if i_poll .eqs. "define"
4630$ then
4631$ OS
4632$ WS "#if defined(__DECC) || defined(__DECCXX)"
4633$ WS "#include <stdlib.h>"
4634$ WS "#endif"
4635$ WS "#include <poll.h>"
4636$ WS "int main()"
4637$ WS "{"
4638$ WS "struct pollfd pfd;"
4639$ WS "int count=poll(&pfd,1,0);"
4640$ WS "exit(0);"
4641$ WS "}"
4642$ CS
4643$ tmp = "poll"
4644$ GOSUB inlibc
4645$ d_poll = tmp
4646$ else
4647$ d_poll = "undef"
4648$ endif
4649$!
570bb66e
JH
4650$! Check for setvbuf
4651$!
4652$ OS
7558ebc2
PP
4653$ WS "#if defined(__DECC) || defined(__DECCXX)"
4654$ WS "#include <stdlib.h>"
4655$ WS "#endif"
4656$ WS "#include <stdio.h>"
4657$ WS "int main()"
570bb66e 4658$ WS "{"
7558ebc2
PP
4659$ WS "FILE *foo;"
4660$ WS "char Buffer[99];"
4661$ WS "foo = fopen(""foo"", ""r"");"
4662$ WS "setvbuf(foo, Buffer, 0, 0);"
4663$ WS "exit(0);"
570bb66e
JH
4664$ WS "}"
4665$ CS
4666$ tmp = "setvbuf"
4667$ GOSUB inlibc
4668$ d_setvbuf = tmp
4669$!
3f88addd
CB
4670$! Check for the shm* routines.
4671$!
4672$ OS
4673$ WS "#if defined(__DECC) || defined(__DECCXX)"
4674$ WS "#include <stdlib.h>"
4675$ WS "#endif"
4676$ WS "#include <stdio.h>"
4677$ WS "#include <sys/shm.h>"
4678$ WS "#include <sys/stat.h>"
4679$ WS "int shmget(key_t key, size_t size, int shmflg);"
4680$ WS "void* shmat(int shmid,const void *shmaddr,int shmflg);"
4681$ WS "int shmctl(int shmid, int cmd, struct shmid_ds *buf);"
4682$ WS "int shmdt(const void *shmaddr);"
4683$ WS "int main() {"
4684$ WS "int shm_id = shmget(IPC_PRIVATE, 8, S_IRWXU);"
4685$ WS "if (shm_id == -1) printf(""0\n""); else printf (""1\n"");"
4686$ WS "}"
4687$ CS
4688$ GOSUB compile
4689$ IF tmp .EQS. "1"
4690$ THEN
4691$ d_shm = "define"
4692$ d_shmat = "define"
4693$ d_shmatprototype = "define"
4694$ d_shmctl = "define"
4695$ d_shmdt = "define"
4696$ d_shmget = "define"
4697$ shmattype = "void *"
4698$ ELSE
4699$ d_shm = "undef"
4700$ d_shmat = "undef"
4701$ d_shmatprototype = "undef"
4702$ d_shmctl = "undef"
4703$ d_shmdt = "undef"
4704$ d_shmget = "undef"
4705$ shmattype = "undef"
4706$ ENDIF
4707$!
570bb66e
JH
4708$! Check for setenv
4709$!
4710$ OS
7558ebc2
PP
4711$ WS "#if defined(__DECC) || defined(__DECCXX)"
4712$ WS "#include <stdlib.h>"
4713$ WS "#endif"
4714$ WS "#include <stdio.h>"
4715$ WS "int main()"
570bb66e 4716$ WS "{"
7558ebc2
PP
4717$ WS "setenv(""FOO"", ""BAR"", 0);"
4718$ WS "exit(0);"
570bb66e
JH
4719$ WS "}"
4720$ CS
4721$ tmp = "setenv"
4722$ GOSUB inlibc
4723$ d_setenv = tmp
4724$!
4725$! Check for setproctitle
4726$!
4727$ OS
7558ebc2
PP
4728$ WS "#if defined(__DECC) || defined(__DECCXX)"
4729$ WS "#include <stdlib.h>"
4730$ WS "#endif"
4731$ WS "#include <stdio.h>"
4732$ WS "int main()"
570bb66e 4733$ WS "{"
7558ebc2
PP
4734$ WS "setproctitle(""%s"", ""FOO"");"
4735$ WS "exit(0);"
570bb66e
JH
4736$ WS "}"
4737$ CS
4738$ tmp = "setproctitle"
4739$ GOSUB inlibc
4740$ d_setproctitle = tmp
4741$!
4742$! Check for <netinet/in.h>
4743$!
046cc26c 4744$ IF Has_Dec_C_Sockets
570bb66e
JH
4745$ THEN
4746$ tmp = "netinet/in.h"
4747$ GOSUB inhdr
4748$ i_niin = tmp
4749$ ELSE
4750$ i_niin="undef"
4751$ ENDIF
4752$!
53eda0bf
CB
4753$! Check for <arpa/inet.h>
4754$!
4755$ IF Has_Dec_C_Sockets
4756$ THEN
4757$ tmp = "arpa/inet.h"
4758$ GOSUB inhdr
4759$ i_arpainet = tmp
4760$ ELSE
4761$ i_arpainet="undef"
4762$ ENDIF
4763$!
4764$! Check for <sys/un.h>
4765$!
4766$ IF Has_Dec_C_Sockets
4767$ THEN
4768$ tmp = "sys/un.h"
4769$ GOSUB inhdr
4770$ i_sysun = tmp
4771$ ELSE
4772$ i_sysun="undef"
4773$ ENDIF
4774$!
4775$!
570bb66e
JH
4776$! Check for <netinet/tcp.h>
4777$!
046cc26c 4778$ IF Has_Dec_C_Sockets
570bb66e
JH
4779$ THEN
4780$ tmp = "netinet/tcp.h"
4781$ GOSUB inhdr
4782$ i_netinettcp = tmp
4783$ ELSE
4784$ i_netinettcp="undef"
4785$ ENDIF
4786$!
4787$! Check for endhostent
4788$!
046cc26c 4789$ IF Has_Dec_C_Sockets
570bb66e
JH
4790$ THEN
4791$ OS
7558ebc2
PP
4792$ WS "#if defined(__DECC) || defined(__DECCXX)"
4793$ WS "#include <stdlib.h>"
4794$ WS "#endif"
4795$ WS "#include <stdio.h>"
046cc26c 4796$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4797$ WS "int main()"
570bb66e 4798$ WS "{"
7558ebc2
PP
4799$ WS "endhostent();"
4800$ WS "exit(0);"
570bb66e
JH
4801$ WS "}"
4802$ CS
4803$ tmp = "endhostent"
4804$ GOSUB inlibc
4805$ d_endhent = tmp
4806$ ELSE
4807$ d_endhent="undef"
4808$ ENDIF
4809$!
4810$! Check for endnetent
4811$!
046cc26c 4812$ IF Has_Dec_C_Sockets
570bb66e
JH
4813$ THEN
4814$ OS
7558ebc2
PP
4815$ WS "#if defined(__DECC) || defined(__DECCXX)"
4816$ WS "#include <stdlib.h>"
4817$ WS "#endif"
4818$ WS "#include <stdio.h>"
046cc26c 4819$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e
JH
4820$ WS "int main()"
4821$ WS "{"
4822$ WS "endnetent();"
4823$ WS "exit(0);"
4824$ WS "}"
4825$ CS
4826$ tmp = "endnetent"
4827$ GOSUB inlibc
4828$ d_endnent = tmp
4829$ ELSE
4830$ d_endnent="undef"
4831$ ENDIF
4832$!
4833$! Check for endprotoent
4834$!
046cc26c 4835$ IF Has_Dec_C_Sockets
570bb66e
JH
4836$ THEN
4837$ OS
7558ebc2
PP
4838$ WS "#if defined(__DECC) || defined(__DECCXX)"
4839$ WS "#include <stdlib.h>"
4840$ WS "#endif"
4841$ WS "#include <stdio.h>"
046cc26c 4842$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4843$ WS "int main()"
570bb66e 4844$ WS "{"
7558ebc2
PP
4845$ WS "endprotoent();"
4846$ WS "exit(0);"
570bb66e
JH
4847$ WS "}"
4848$ CS
4849$ tmp = "endprotoent"
4850$ GOSUB inlibc
4851$ d_endpent = tmp
4852$ ELSE
4853$ d_endpent="undef"
4854$ ENDIF
4855$!
4856$! Check for endservent
4857$!
046cc26c 4858$ IF Has_Dec_C_Sockets
570bb66e
JH
4859$ THEN
4860$ OS
7558ebc2
PP
4861$ WS "#if defined(__DECC) || defined(__DECCXX)"
4862$ WS "#include <stdlib.h>"
4863$ WS "#endif"
4864$ WS "#include <stdio.h>"
046cc26c 4865$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4866$ WS "int main()"
570bb66e 4867$ WS "{"
7558ebc2
PP
4868$ WS "endservent();"
4869$ WS "exit(0);"
570bb66e
JH
4870$ WS "}"
4871$ CS
4872$ tmp = "endservent"
4873$ GOSUB inlibc
4874$ d_endsent = tmp
4875$ ELSE
4876$ d_endsent="undef"
4877$ ENDIF
4878$!
4879$! Check for sethostent
4880$!
046cc26c 4881$ IF Has_Dec_C_Sockets
570bb66e
JH
4882$ THEN
4883$ OS
7558ebc2
PP
4884$ WS "#if defined(__DECC) || defined(__DECCXX)"
4885$ WS "#include <stdlib.h>"
4886$ WS "#endif"
4887$ WS "#include <stdio.h>"
046cc26c 4888$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4889$ WS "int main()"
570bb66e 4890$ WS "{"
7558ebc2
PP
4891$ WS "sethostent(1);"
4892$ WS "exit(0);"
570bb66e
JH
4893$ WS "}"
4894$ CS
4895$ tmp = "sethostent"
4896$ GOSUB inlibc
4897$ d_sethent = tmp
4898$ ELSE
4899$ d_sethent="undef"
4900$ ENDIF
4901$!
4902$! Check for setnetent
4903$!
046cc26c 4904$ IF Has_Dec_C_Sockets
570bb66e
JH
4905$ THEN
4906$ OS
7558ebc2
PP
4907$ WS "#if defined(__DECC) || defined(__DECCXX)"
4908$ WS "#include <stdlib.h>"
4909$ WS "#endif"
4910$ WS "#include <stdio.h>"
046cc26c 4911$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4912$ WS "int main()"
570bb66e 4913$ WS "{"
7558ebc2
PP
4914$ WS "setnetent(1);"
4915$ WS "exit(0);"
570bb66e
JH
4916$ WS "}"
4917$ CS
4918$ tmp = "setnetent"
4919$ GOSUB inlibc
4920$ d_setnent = tmp
4921$ ELSE
4922$ d_setnent="undef"
4923$ ENDIF
4924$!
4925$! Check for setprotoent
4926$!
046cc26c 4927$ IF Has_Dec_C_Sockets
570bb66e
JH
4928$ THEN
4929$ OS
7558ebc2
PP
4930$ WS "#if defined(__DECC) || defined(__DECCXX)"
4931$ WS "#include <stdlib.h>"
4932$ WS "#endif"
4933$ WS "#include <stdio.h>"
046cc26c 4934$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4935$ WS "int main()"
570bb66e 4936$ WS "{"
7558ebc2
PP
4937$ WS "setprotoent(1);"
4938$ WS "exit(0);"
570bb66e
JH
4939$ WS "}"
4940$ CS
4941$ tmp = "setprotoent"
4942$ GOSUB inlibc
4943$ d_setpent = tmp
4944$ ELSE
4945$ d_setpent="undef"
4946$ ENDIF
4947$!
4948$! Check for setservent
4949$!
046cc26c 4950$ IF Has_Dec_C_Sockets
570bb66e
JH
4951$ THEN
4952$ OS
7558ebc2
PP
4953$ WS "#if defined(__DECC) || defined(__DECCXX)"
4954$ WS "#include <stdlib.h>"
4955$ WS "#endif"
4956$ WS "#include <stdio.h>"
046cc26c 4957$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4958$ WS "int main()"
570bb66e 4959$ WS "{"
7558ebc2
PP
4960$ WS "setservent(1);"
4961$ WS "exit(0);"
570bb66e
JH
4962$ WS "}"
4963$ CS
4964$ tmp = "setservent"
4965$ GOSUB inlibc
4966$ d_setsent = tmp
4967$ ELSE
4968$ d_setsent="undef"
4969$ ENDIF
4970$!
4971$! Check for gethostent
4972$!
046cc26c 4973$ IF Has_Dec_C_Sockets
570bb66e
JH
4974$ THEN
4975$ OS
7558ebc2
PP
4976$ WS "#if defined(__DECC) || defined(__DECCXX)"
4977$ WS "#include <stdlib.h>"
4978$ WS "#endif"
4979$ WS "#include <stdio.h>"
046cc26c 4980$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 4981$ WS "int main()"
570bb66e 4982$ WS "{"
7558ebc2
PP
4983$ WS "gethostent();"
4984$ WS "exit(0);"
570bb66e
JH
4985$ WS "}"
4986$ CS
4987$ tmp = "gethostent"
4988$ GOSUB inlibc
4989$ d_gethent = tmp
4990$ ELSE
4991$ d_gethent="undef"
4992$ ENDIF
4993$!
4994$! Check for getnetent
4995$!
046cc26c 4996$ IF Has_Dec_C_Sockets
570bb66e
JH
4997$ THEN
4998$ OS
7558ebc2
PP
4999$ WS "#if defined(__DECC) || defined(__DECCXX)"
5000$ WS "#include <stdlib.h>"
5001$ WS "#endif"
5002$ WS "#include <stdio.h>"
046cc26c 5003$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 5004$ WS "int main()"
570bb66e 5005$ WS "{"
7558ebc2
PP
5006$ WS "getnetent();"
5007$ WS "exit(0);"
570bb66e
JH
5008$ WS "}"
5009$ CS
5010$ tmp = "getnetent"
5011$ GOSUB inlibc
5012$ d_getnent = tmp
5013$ ELSE
5014$ d_getnent="undef"
5015$ ENDIF
5016$!
5017$! Check for getprotoent
5018$!
046cc26c 5019$ IF Has_Dec_C_Sockets
570bb66e
JH
5020$ THEN
5021$ OS
7558ebc2
PP
5022$ WS "#if defined(__DECC) || defined(__DECCXX)"
5023$ WS "#include <stdlib.h>"
5024$ WS "#endif"
5025$ WS "#include <stdio.h>"
046cc26c 5026$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 5027$ WS "int main()"
570bb66e 5028$ WS "{"
7558ebc2
PP
5029$ WS "getprotoent();"
5030$ WS "exit(0);"
570bb66e
JH
5031$ WS "}"
5032$ CS
5033$ tmp = "getprotoent"
5034$ GOSUB inlibc
5035$ d_getpent = tmp
5036$ ELSE
5037$ d_getpent="undef"
5038$ ENDIF
5039$!
5040$! Check for getservent
5041$!
046cc26c 5042$ IF Has_Dec_C_Sockets
570bb66e
JH
5043$ THEN
5044$ OS
7558ebc2
PP
5045$ WS "#if defined(__DECC) || defined(__DECCXX)"
5046$ WS "#include <stdlib.h>"
5047$ WS "#endif"
5048$ WS "#include <stdio.h>"
046cc26c 5049$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 5050$ WS "int main()"
570bb66e 5051$ WS "{"
7558ebc2
PP
5052$ WS "getservent();"
5053$ WS "exit(0);"
570bb66e
JH
5054$ WS "}"
5055$ CS
5056$ tmp = "getservent"
5057$ GOSUB inlibc
5058$ d_getsent = tmp
5059$ ELSE
5060$ d_getsent="undef"
5061$ ENDIF
5062$!
234242ca
CB
5063$!
5064$! Check for sa_len
5065$!
5066$ echo4 "Checking the availability of sa_len in the sockaddr struct ..."
046cc26c 5067$ IF Has_Dec_C_Sockets
234242ca
CB
5068$ THEN
5069$ OS
5070$ WS "#if defined(__DECC) || defined(__DECCXX)"
5071$ WS "#include <stdlib.h>"
5072$ WS "#endif"
5073$ WS "#define _SOCKADDR_LEN"
5074$ WS "#include <types.h>"
046cc26c 5075$ WS "#include <socket.h>"
85fac3a9 5076$ WS "#include <string.h>"
234242ca
CB
5077$ WS "int main() {"
5078$ WS "struct sockaddr sa;"
85fac3a9 5079$ WS "memset((char *)&sa, 0, sizeof(sa));"
234242ca
CB
5080$ WS "return (sa.sa_len);"
5081$ WS "}"
5082$ CS
5083$ GOSUB compile_ok
5084$ IF compile_status .EQ. good_compile
5085$ THEN
5086$ d_sockaddr_sa_len="define"
5087$ echo "You have sa_len in the sockaddr struct."
5088$ ELSE
5089$ d_sockaddr_sa_len="undef"
5090$ echo "You do not have sa_len in the sockaddr struct."
5091$ ENDIF
5092$ ELSE
5093$ d_sockaddr_sa_len="undef"
5094$ echo "You do not have sa_len in the sockaddr struct."
5095$ ENDIF
d9484470
CB
5096$!
5097$! Check for sin6_scope_id
5098$!
5099$ echo4 "Checking the availability of sin6_scope_id in the struct sockaddr_in6 ..."
046cc26c 5100$ IF Has_Dec_C_Sockets
d9484470
CB
5101$ THEN
5102$ OS
5103$ WS "#include <types.h>"
046cc26c 5104$ WS "#include <socket.h>"
d9484470 5105$ WS "#include <in.h>"
85fac3a9 5106$ WS "#include <string.h>"
d9484470
CB
5107$ WS "int main() {"
5108$ WS "struct sockaddr_in6 sin6;"
85fac3a9 5109$ WS "memset((char *)&sin6, 0, sizeof(sin6));"
d9484470
CB
5110$ WS "return (sin6.sin6_scope_id);"
5111$ WS "}"
5112$ CS
5113$ GOSUB compile_ok
5114$ IF compile_status .EQ. good_compile
5115$ THEN
5116$ d_sin6_scope_id="define"
5117$ echo "You have sin6_scope_id in the sockaddr_in6 struct."
5118$ ELSE
5119$ d_sin6_scope_id="undef"
5120$ echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
5121$ ENDIF
5122$ ELSE
5123$ d_sin6_scope_id="undef"
5124$ echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
5125$ ENDIF
5126$!
02e1c2f1
CB
5127$! Check for nanosleep
5128$!
5129$ OS
5130$ WS "#if defined(__DECC) || defined(__DECCXX)"
5131$ WS "#include <stdlib.h>"
5132$ WS "#endif"
5133$ WS "#include <time.h>"
5134$ WS "int main()"
5135$ WS "{"
5136$ WS "int asleep = nanosleep(NULL,NULL);"
5137$ WS "exit(0);"
5138$ WS "}"
5139$ CS
5140$ tmp = "nanosleep"
5141$ GOSUB inlibc
5142$ d_nanosleep = tmp
5143$!
570bb66e
JH
5144$! Check for socklen_t
5145$!
046cc26c 5146$ IF Has_Dec_C_Sockets
570bb66e
JH
5147$ THEN
5148$ echo4 "Checking to see if you have socklen_t..."
5149$ OS
7558ebc2
PP
5150$ WS "#if defined(__DECC) || defined(__DECCXX)"
5151$ WS "#include <stdlib.h>"
5152$ WS "#endif"
5153$ WS "#include <stdio.h>"
046cc26c 5154$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
7558ebc2 5155$ WS "int main()"
570bb66e 5156$ WS "{"
7558ebc2
PP
5157$ WS "socklen_t x = 16;"
5158$ WS "exit(0);"
570bb66e
JH
5159$ WS "}"
5160$ CS
5161$ GOSUB link_ok
5162$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5163$ THEN
5164$ d_socklen_t="define"
5165$ echo "You have socklen_t."
5166$ ELSE
5167$ d_socklen_t="undef"
5168$ echo "You do not have socklen_t."
5169$ ENDIF
5170$ ELSE
5171$ d_socklen_t="undef"
5172$ ENDIF
5173$!
5174$! Check for pthread_yield
5175$!
5176$ IF use_threads
5177$ THEN
5178$ OS
7558ebc2
PP
5179$ WS "#if defined(__DECC) || defined(__DECCXX)"
5180$ WS "#include <stdlib.h>"
5181$ WS "#endif"
5182$ WS "#include <pthread.h>"
5183$ WS "#include <stdio.h>"
5184$ WS "int main()"
570bb66e 5185$ WS "{"
7558ebc2
PP
5186$ WS "pthread_yield();"
5187$ WS "exit(0);"
570bb66e
JH
5188$ WS "}"
5189$ CS
5190$ tmp = "pthread_yield"
5191$ GOSUB inlibc
5192$ d_pthread_yield = tmp
5193$ ELSE
5194$ d_pthread_yield="undef"
5195$ ENDIF
5196$!
5197$! Check for sched_yield
5198$!
5199$ IF use_threads
5200$ THEN
5201$ OS
7558ebc2
PP
5202$ WS "#if defined(__DECC) || defined(__DECCXX)"
5203$ WS "#include <stdlib.h>"
5204$ WS "#endif"
5205$ WS "#include <pthread.h>"
5206$ WS "#include <stdio.h>"
5207$ WS "int main()"
570bb66e 5208$ WS "{"
7558ebc2
PP
5209$ WS "sched_yield();"
5210$ WS "exit(0);"
570bb66e
JH
5211$ WS "}"
5212$ CS
5213$ tmp = "sched_yield"
5214$ GOSUB inlibc
5215$ d_sched_yield = tmp
5216$ IF d_sched_yield .EQS. "define"
5217$ THEN sched_yield = "sched_yield"
5218$ ELSE sched_yield = " "
5219$ ENDIF
5220$ ELSE
5221$ d_sched_yield="undef"
5222$ sched_yield = " "
5223$ ENDIF
5224$!
e0e3c57a
JH
5225$! Check for pthread_attr_setscope and PTHREAD_SCOPE_SYSTEM.
5226$! (The actual test is to be written.)
5227$!
5228$ d_pthread_attr_setscope="undef"
5229$!
570bb66e
JH
5230$! Check for generic pointer size
5231$!
5232$ echo4 "Checking to see how big your pointers are..."
5233$ OS
7558ebc2
PP
5234$ WS "#if defined(__DECC) || defined(__DECCXX)"
5235$ WS "#include <stdlib.h>"
5236$ WS "#endif"
5237$ WS "#include <stdio.h>"
5238$ WS "int main()"
570bb66e 5239$ WS "{"
7558ebc2
PP
5240$ WS "int foo;"
5241$ WS "foo = sizeof(char *);"
5242$ WS "printf(""%d\n"", foo);"
5243$ WS "exit(0);"
570bb66e
JH
5244$ WS "}"
5245$ CS
5246$ tmp = "char *"
5247$ GOSUB type_size_check
5248$ ptrsize = tmp
5249$ echo "Your pointers are ''ptrsize' bytes long."
5250$!
5251$! Check for size_t size
5252$!
5253$ tmp = "size_t"
5254$ zzz = tmp
5255$ echo4 "Checking the size of ''zzz'..."
5256$ GOSUB type_size_check
5257$ sizesize = tmp
5258$ echo "Your ''zzz' size is ''sizesize' bytes."
5259$!
e0261ef8
CB
5260$! Check for _LARGEFILE capability.
5261$!
5262$ off_t_size = 4
5263$ OS
5264$ WS "#define _LARGEFILE"
5265$ WS "#include <stdio.h>"
5266$ WS "int main()"
5267$ WS "{"
5268$ WS "printf(""%d\n"", sizeof(off_t));"
5269$ WS "return(0);"
5270$ WS "}"
5271$ CS
5272$ GOSUB link_ok
5273$ IF link_status .EQ. good_link
5274$ THEN
5275$ GOSUB just_mcr_it
5276$ off_t_size = tmp
5277$ ENDIF
5278$ echo "Your off_t size is ''off_t_size' bytes when _LARGEFILE is defined."
5279$ IF off_t_size .ne. 8 .AND. (uselargefiles .OR. uselargefiles .eqs. "define")
5280$ THEN
5281$ echo4 "You configured with -Duselargefiles but your CRTL does not support _LARGEFILE."
5282$ echo4 "I'm disabling large file support."
5283$ uselargefiles = "undef"
5284$ ENDIF
5285$!
17660758
CB
5286$! Check for st_ino size.
5287$!
5288$ st_ino_size = 4
5289$ OS
5290$ WS "#include <sys/stat.h>"
5291$ WS "#include <stdio.h>"
5292$ WS "#if defined(__DECC) || defined(__DECCXX)"
5293$ WS "#include <stdlib.h>
5294$ WS "#endif"
5295$ WS "int main() {
5296$ WS "#''uselargefiles' _LARGEFILE"
5297$ WS "#ifdef _LARGEFILE"
5298$ WS " printf(""%d\n"", sizeof(__ino64_t));"
5299$ WS "#else"
5300$ WS " printf(""%d\n"", sizeof(unsigned short)*3);"
5301$ WS "#endif"
5302$ WS " exit(0);"
5303$ WS "}"
5304$ CS
5305$ GOSUB link_ok
5306$ IF link_status .EQ. good_link
5307$ THEN
5308$ GOSUB just_mcr_it
5309$ st_ino_size = tmp
5310$ ENDIF
5311$ echo "Your st_ino size is ''st_ino_size' bytes."
5312$!
96021e87
JM
5313$! Tests for hard link, symbolic links, and 7.3 + CRTL features
5314$!
5315$ d_lchown = "undef"
5316$ d_link = "undef"
5317$ d_lstat = "undef"
5318$ d_readlink = "undef"
5319$ d_symlink = "undef"
5320$ d_realpath = "undef"
96021e87
JM
5321$!
5322$! Hard link support has been present since 7.3-1 except for the
5323$! easy to use DCL test to see if hardlinks are enabled on the build
5324$! disk. That would require more work to test, and I am only testing
5325$! this on 8.2, so that is why the 8.2 test.
5326$!
054a3baf 5327$ IF (vms_ver .GES. "8.2")
96021e87
JM
5328$ THEN
5329$ IF f$getdvi("SYS$DISK","HARDLINKS_SUPPORTED")
5330$ THEN
5331$ echo "I Found 64 bit OpenVMS 8.2 or later, and hard links enabled on build disk."
5332$ echo "I will build with hard link support"
5333$ d_link = "define"
5334$ ELSE
5335$ echo "I Found 64 bit OpenVMS 8.2 or later, and hard links disabled on build disk."
5336$ echo "I will not build with hard link support."
5337$ ENDIF
5338$ ELSE
d00eb249 5339$ echo4 "I can not detect if your CRTL and build disk support hard links."
96021e87
JM
5340$ echo4 "I am disabling hard link support."
5341$ ENDIF
5342$!
5343$ IF uselargefiles .OR. uselargefiles .eqs. "define"
5344$ THEN
054a3baf 5345$ IF (vms_ver .GES. "8.2")
96021e87 5346$ THEN
fe6e2aaa
CB
5347$ echo4 "Largefile support enabled, so enabling standard stat support too."
5348$ usestdstat = "y"
96021e87
JM
5349$ echo4 -
5350 "Looking for the realpath() function to indicate symbolic link support..."
5351$ OS
85fac3a9 5352$ WS "#include <stdlib.h>"
96021e87
JM
5353$ WS "char *realpath(const char *file_name, char * resolved_name, ...);"
5354$ WS "int main()"
5355$ WS "{"
5356$ WS "char result[255];"
5357$ WS "realpath(""foo"",result);"
5358$ WS "exit(0);"
5359$ WS "}"
5360$ CS
5361$ GOSUB link_ok
5362$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
5363$ THEN
5364$ echo -
5365 "Found realpath() which indicates symbolic link support is present."
5366$ d_lchown = "define"
5367$ d_lstat = "define"
5368$ d_readlink = "define"
5369$ d_symlink = "define"
5370$! d_realpath = "define" ! Perl will not put it in the config.h file?
5371$! Perl apparently does not use a built in realpath() on other platforms,
5372$! but there is a severe performance penatly on OpenVMS to use the Perl
5373$! script that implements a realpath(). The d_symlink symbol is used
5374$! as a replacement for the d_realpath since they are related and both
5375$! were activated by the CRTL at the same time.
5376$!
5377$ ELSE
5378$ echo4 "Your system does not support symbolic links."
5379$ echo4 "I am disabling symbolic link support."
5380$ ENDIF
5381$ ELSE
5382$ echo4 "Your system does not support symbolic links."
5383$ echo4 "I am disabling symbolic link support."
5384$ ENDIF
5385$ ELSE
054a3baf 5386$ IF (vms_ver .GES. "8.2")
96021e87 5387$ THEN
d00eb249 5388$ echo4 "-Duselargefiles is required for symbolic link support."
96021e87
JM
5389$ echo4 "You did not specify that, so I am disabling symbolic link support."
5390$ ENDIF
5391$ ENDIF
5392$!
9fa802f3
CB
5393$!
5394$! Check for grp.h -- should be 7.3 and later, but test to be sure
5395$!
5396$ tmp = "grp.h"
5397$ GOSUB inhdr
5398$ i_grp = tmp
5399$!
96021e87
JM
5400$! VMS V7.3-2 powered options
5401$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
96021e87
JM
5402$!
5403$ d_getgrgid_r = "undef"
5404$ getgrgid_r_proto = "0"
5405$ d_getgrnam_r = "undef"
5406$ getgrnam_r_proto = "0"
5407$ d_getpgid = "undef"
5408$ d_getpgrp = "undef"
9fa802f3
CB
5409$! N.B. We already have home-grown thread-safe versions of
5410$! getpwnam and getpwuid -- no need to use CRTL versions
96021e87
JM
5411$ d_getpwnam_r = "undef"
5412$ getpwnam_r_proto = "0"
5413$ d_getpwuid_r = "undef"
5414$ getpwuid_r_proto = "0"
054a3baf
CB
5415$ echo "Asumming 64-bit OpenVMS ''vms_ver' -- will build with V7.3-2 routines"
5416$ d_getgrgid_r = "define"
5417$ getgrgid_r_proto = "1"
5418$ d_getgrnam_r = "define"
5419$ getgrnam_r_proto = "1"
5420$ if d_symlink .or. d_symlink .EQS. "define"
96021e87 5421$ then
96021e87
JM
5422$! FIXME: Need to find how to activate this.
5423$! d_getpgid = "define"
5424$! d_getpgrp = "define"
96021e87 5425$ endif
054a3baf
CB
5426$ d_setgrent = "define"
5427$ d_ttyname_r = "define"
5428$ ttyname_r_proto = "1"
4059ba87
AC
5429$ d_snprintf = "define"
5430$ d_vsnprintf = "define"
96021e87
JM
5431$!
5432$! VMS V7.3-2 powered options
5433$! We know that it is only available for V7.3-2 and later on 64 bit platforms.
5434$! Only implementing right now on 8.2 because that is what I am testing
5435$! These functions may require POSIX UIDs/GIDs to be active, so I am
5436$! not activating the features at this time, just preparing this file
5437$! to easily use them in the future.
5438$!
5439$ d_seteuid = "undef"
5440$ d_setpgid = "undef"
5441$ d_setpgrp = "undef"
5442$ d_setregid = "undef"
5443$ d_setreuid = "undef"
5444$ d_setsid = "undef"
d00eb249 5445$ ! Disable this section for now.
054a3baf 5446$!$ if (vms_ver .GES. "8.2")
d00eb249 5447$ if .NOT. 1
96021e87 5448$ then
d00eb249 5449$ echo "Found 64 bit OpenVMS ''vms_ver' -- will build with V7.3-2 UID setting routines"
96021e87
JM
5450$ d_seteuid = "define"
5451$ d_setpgid = "define"
5452$ d_setpgrp = "define"
5453$ d_setregid = "define"
5454$ d_setreuid = "define"
5455$ d_setsid = "define"
5456$ endif
5457$!
ea442100
JH
5458$! VMS V8 powered options
5459$! We know that it is only available for 8.2 and later on 64 bit platforms.
5460$!
5461$ d_fstatvfs = "undef"
5462$ d_statvfs = "undef"
5463$ i_sysstatvfs = "undef"
5464$ if (vms_ver .GES. "8.2")
5465$ then
5466$ echo "Found 64 bit OpenVMS ''vms_ver' -- will build with 8.2 routines"
5467$ d_fstatvfs = "define"
5468$ d_statvfs = "define"
5469$ i_sysstatvfs = "define"
5470$ endif
5471$!
570bb66e
JH
5472$! Check rand48 and its ilk
5473$!
7e0a9dba
CB
5474$ echo4 "Using our internal random number implementation..."
5475$!
5476$ randfunc = "Perl_drand48"
5477$ drand01 = "Perl_drand48()"
5478$ seedfunc = "Perl_drand48_init"
5479$ randbits = "48"
5480$ randseedtype = "U32"
5481$ d_drand48proto = "define"
5482$!
570bb66e
JH
5483$! Done with compiler checks. Clean up.
5484$ IF F$SEARCH("try.c") .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
5485$ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
5486$ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
5487$ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
5488$ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
414b89cc 5489$ IF ccname .EQS. "CXX"
570bb66e
JH
5490$ THEN
5491$ CALL Cxx_demangler_cleanup
5492$ ENDIF
5493$!
5494$! Some that are compiler or VMS version sensitive
5495$!
5496$! Gnu C stuff
414b89cc 5497$ IF ccname .EQS. "GCC"
570bb66e
JH
5498$ THEN
5499$ d_attribut="define"
5500$ vms_cc_type="gcc"
5501$ ELSE
85fac3a9
CB
5502$ IF ccname .EQS. "CXX"
5503$ THEN
5504$ vms_cc_type="cxx"
5505$ ELSE
5506$ vms_cc_type="cc"
5507$ ENDIF
570bb66e
JH
5508$ d_attribut="undef"
5509$ ENDIF
5510$!
85fac3a9
CB
5511$ d_getitimer="define"
5512$ d_gettimeod="define"
5513$ d_mmap="define"
5514$ d_mprotect="define"
5515$ d_munmap="define"
5516$ d_msync="define"
5517$ d_ualarm="define"
5518$ d_uname="define"
5519$! d_unsetenv="define" ! Fix me - Activating requires changing VMS code
5520$ d_unsetenv="undef" ! Change will be needed to allow GNV integration
5521$ d_clearenv="undef"
5522$ d_usleep="define"
5523$ d_setitimer="define"
5524$ d_sigaction="define"
6aa3d1f7
CB
5525$ d_siginfo_si_addr="define"
5526$ d_siginfo_si_band="define"
5527$ d_siginfo_si_errno="define"
354810ee 5528$ d_siginfo_si_fd="define"
6aa3d1f7
CB
5529$ d_siginfo_si_pid="define"
5530$ d_siginfo_si_status="define"
5531$ d_siginfo_si_uid="define"
5532$ d_siginfo_si_value="define"
85fac3a9
CB
5533$ d_sigprocmask="define"
5534$ d_truncate="define"
5535$ d_wait4="define"
5536$ d_index="define"
5537$ pidtype="pid_t"
5538$ sig_name1="ZERO HUP INT QUIT ILL TRAP ABRT EMT FPE KILL BUS SEGV SYS PIPE"
5539$ sig_name2=" ALRM TERM USR1 USR2 NUM18 NUM19 CHLD CONT STOP TSTP TTIN TTOU DEBUG"
054a3baf 5540$ sig_name2 = sig_name2 + " NUM27 WINCH"
fe1de8ce
CB
5541$!* signal.h defines SIGRTMIN as 33 and SIGRTMAX as 64, but there is no
5542$!* sigqueue function or other apparent means to do realtime signalling,
5543$!* so let's not try to include the realtime range for now.
5544$!* sig_name3=" NUM29 NUM30 NUM31 NUM32 RTMIN NUM34 NUM35 NUM36 NUM37 NUM38 NUM39 NUM40 NUM41 NUM42 NUM43"
5545$!* sig_name4=" NUM44 NUM45 NUM46 NUM47 NUM48 NUM49 NUM50 NUM51 NUM52 NUM53 NUM54 NUM55 NUM56 NUM57 NUM58"
5546$!* sig_name5=" NUM59 NUM60 NUM61 NUMT62 NUM63 RTMAX"
85fac3a9
CB
5547$ sig_name = sig_name1 + sig_name2
5548$ sig_num = ""
5549$ sig_num_init = ""
5550$ sig_name_init = ""
5551$ sig_index = 0
fe1de8ce
CB
5552$!
5553$ PARSE_SIG_NAME_LOOP:
5554$!
5555$ tmp = F$ELEMENT(sig_index, " ", sig_name)
5556$ IF F$LENGTH(F$EDIT(tmp,"TRIM")) .eq. 0 THEN GOTO END_SIG_NAME_LOOP
5557$ sig_name_init = sig_name_init + """''tmp'"","
5558$ sig_num = sig_num + "''sig_index' "
5559$ sig_num_init = sig_num_init + "''sig_index',"
5560$ sig_index = sig_index + 1
5561$ GOTO PARSE_SIG_NAME_LOOP
5562$!
5563$ END_SIG_NAME_LOOP:
5564$!
5565$ sig_name_init = sig_name_init + "0"
5566$ sig_num_init = sig_num_init + "0"
5567$ sig_size = "''sig_index'"
5568$ sig_index = sig_index - 1
5569$ sig_count = "''sig_index'"
570bb66e
JH
5570$ uidtype="uid_t"
5571$ d_pathconf="define"
5572$ d_fpathconf="define"
5573$ d_sysconf="define"
5574$ d_sigsetjmp="define"
85fac3a9 5575$!
a3bd614a
PP
5576$!: see if tzname[] exists
5577$ OS
5578$ WS "#include <stdio.h>"
5579$ WS "#include <time.h>"
5580$ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
5581$ CS
5582$ GOSUB compile_ok
5583$ IF compile_status .EQ. good_compile
5584$ THEN
5585$ d_tzname = "undef"
5586$ echo4 "tzname[] NOT found."
5587$ ELSE
5588$ d_tzname = "define"
5589$ echo4 "tzname[] found."
5590$ ENDIF
5591$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
570bb66e 5592$!
414b89cc
CB
5593$ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
5594$ THEN
5595$ d_phostname="define"
5596$ ELSE
5597$ d_phostname="undef"
5598$ ENDIF
5599$!
570bb66e 5600$! Dec C alone
85fac3a9 5601$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
570bb66e 5602$ THEN
570bb66e 5603$ vms_cc_type="decc"
570bb66e 5604$ ENDIF
c9186d06 5605$ d_faststdio="define"
7db2b62c
KW
5606$ d_ffs="undef"
5607$ d_ffsl="undef"
9d228af7 5608$ d_getenv_preserves_other_thread="define"
c9186d06
CB
5609$ d_locconv="define"
5610$ d_mblen="define"
5611$ d_mbstowcs="define"
5612$ d_mbtowc="define"
5613$ d_mktime="define"
5614$ d_nl_langinfo="define"
bfe51271 5615$ d_non_int_bitfields="define"
c9186d06 5616$ d_setlocale="define"
2e3ef32f 5617$ d_setlocale_accepts_any_locale_name="undef"
c9186d06
CB
5618$ d_stdiobase="define"
5619$ d_stdio_cnt_lval="define"
5620$ d_stdio_ptr_lval="define"
5621$ d_stdstdio="define"
5622$ d_strcoll="define"
5623$ d_strxfrm="define"
7db2b62c 5624$ d_strxfrm_l="undef"
c9186d06
CB
5625$ i_langinfo="define"
5626$ i_locale="define"
a7ffa9b9 5627$ d_stdio_ptr_lval_sets_cnt="undef"
a15cef0c 5628$ d_stdio_ptr_lval_nochange_cnt="define"
1de32f2a 5629$ usefaststdio="undef"
570bb66e
JH
5630$!
5631$! Sockets?
046cc26c 5632$ if Has_Dec_C_Sockets
570bb66e
JH
5633$ THEN
5634$ d_vms_do_sockets="define"
5635$ d_htonl="define"
5636$ d_socket="define"
96021e87 5637$ d_sockpair = "undef"
054a3baf 5638$ if (vms_ver .GES. "8.2")
96021e87
JM
5639$ then
5640$ echo "Found 64 bit OpenVMS 8.2, will build with socketpair support"
5641$ d_sockpair = "define"
5642$ endif
570bb66e
JH
5643$ d_select="define"
5644$ netdb_hlen_type="int"
5645$ netdb_host_type="char *"
5646$ netdb_name_type="char *"
5647$ netdb_net_type="long"
5648$ d_gethbyaddr="define"
5649$ d_gethbyname="define"
5650$ d_getnbyaddr="define"
5651$ d_getnbyname="define"
5652$ d_getpbynumber="define"
5653$ d_getpbyname="define"
5654$ d_getsbyport="define"
5655$ d_getsbyname="define"
5656$ d_gethostprotos="define"
5657$ d_getnetprotos="define"
5658$ d_getprotoprotos="define"
5659$ d_getservprotos="define"
f37a8e97 5660$ socksizetype="size_t"
570bb66e
JH
5661$ ELSE
5662$ d_vms_do_sockets="undef"
5663$ d_htonl="undef"
5664$ d_socket="undef"
96021e87 5665$ d_socketpair = "undef"
570bb66e
JH
5666$ d_select="undef"
5667$ netdb_hlen_type="int"
5668$ netdb_host_type="char *"
5669$ netdb_name_type="char *"
5670$ netdb_net_type="long"
5671$ d_gethbyaddr="undef"
5672$ d_gethbyname="undef"
5673$ d_getnbyaddr="undef"
5674$ d_getnbyname="undef"
5675$ d_getpbynumber="undef"
5676$ d_getpbyname="undef"
5677$ d_getsbyport="undef"
5678$ d_getsbyname="undef"
5679$ d_gethostprotos="undef"
5680$ d_getnetprotos="undef"
5681$ d_getprotoprotos="undef"
5682$ d_getservprotos="undef"
5683$ socksizetype="undef"
5684$ ENDIF
5685$! Threads
32995a38 5686$ d_oldpthreads="undef"
570bb66e
JH
5687$ IF use_threads
5688$ THEN
5689$ usethreads="define"
5690$ d_pthreads_created_joinable="define"
570bb66e 5691$ ELSE
570bb66e
JH
5692$ usethreads="undef"
5693$ d_pthreads_created_joinable="undef"
5694$ ENDIF
5695$!
5696$! new (5.005_62++) typedefs for primitives
5697$!
5698$ echo "Choosing the C types to be used for Perl's internal types..."
5699$ ivtype="long"
5700$ uvtype="unsigned long"
5701$ i8type="char"
5702$ u8type="unsigned char"
5703$ i16type="short"
5704$ u16type="unsigned short"
5705$ i32type="int"
5706$ u32type="unsigned int"
5707$ i64type="long long"
5708$ u64type="unsigned long long"
5709$ nvtype="double"
5710$!
5711$ IF use64bitint .OR. use64bitint .EQS. "define"
5712$ THEN
5713$ ivtype = "''i64type'"
5714$ uvtype = "''u64type'"
570bb66e 5715$ ENDIF
9d555269
CB
5716$ i64size="8"
5717$ u64size="8"
570bb66e 5718$!
ed3917fd 5719$ doublemantbits = "52"
50ddda1d
CB
5720$ IF uselongdouble .OR. uselongdouble .EQS. "define"
5721$ THEN
5722$ nvtype="long double"
5a14060a
JH
5723$ nvmantbits = longdblmantbits
5724$ ELSE
5725$ nvmantbits = doublemantbits
50ddda1d
CB
5726$ ENDIF
5727$!
570bb66e
JH
5728$ tmp = "''ivtype'"
5729$ GOSUB type_size_check
5730$ ivsize = tmp
570bb66e
JH
5731$ IF ivtype .eqs. "long"
5732$ THEN longsize = tmp
5733$ ELSE
5734$ tmp = "long"
5735$ GOSUB type_size_check
5736$ longsize = tmp
5737$ ENDIF
7558ebc2 5738$!
570bb66e
JH
5739$ tmp = "''uvtype'"
5740$ GOSUB type_size_check
5741$ uvsize = tmp
7558ebc2 5742$!
570bb66e
JH
5743$ tmp = "''i8type'"
5744$ GOSUB type_size_check
5745$ i8size = tmp
7558ebc2 5746$!
570bb66e
JH
5747$ tmp = "''u8type'"
5748$ GOSUB type_size_check
5749$ u8size = tmp
7558ebc2 5750$!
570bb66e
JH
5751$ tmp = "''i16type'"
5752$ GOSUB type_size_check
5753$ i16size = tmp
5754$ IF i16type .eqs. "short"
5755$ THEN shortsize = tmp
5756$ ELSE
5757$ tmp = "short"
5758$ gosub type_size_check
5759$ shortsize = tmp
5760$ ENDIF
7558ebc2 5761$!
570bb66e
JH
5762$ tmp = "''u16type'"
5763$ GOSUB type_size_check
5764$ u16size = tmp
7558ebc2 5765$!
570bb66e
JH
5766$ tmp = "''i32type'"
5767$ GOSUB type_size_check
5768$ i32size = tmp
5769$ IF i32type .eqs. "int"
5770$ THEN intsize = tmp
5771$ ELSE
5772$ tmp = "int"
5773$ gosub type_size_check
5774$ intsize = tmp
5775$ ENDIF
7558ebc2 5776$!
570bb66e
JH
5777$ tmp = "''u32type'"
5778$ gosub type_size_check
5779$ u32size = tmp
7558ebc2 5780$!
570bb66e
JH
5781$ tmp = "''nvtype'"
5782$ GOSUB type_size_check
5783$ nvsize = tmp
5784$!
5785$ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
5786$ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
5787$ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
5788$!
a5bd55ee
CB
5789$ d_nv_preserves_uv = "undef"
5790$ echo4 "Checking how many bits of your UVs your NVs can preserve..."
570bb66e 5791$ OS
7558ebc2
PP
5792$ WS "#if defined(__DECC) || defined(__DECCXX)"
5793$ WS "#include <stdlib.h>"
5794$ WS "#endif"
5795$ WS "#include <stdio.h>"
5796$ WS "int main() {"
a5bd55ee
CB
5797$ WS " ''uvtype' u = 0;"
5798$ WS " int n = 8 * ''uvsize';"
5799$ WS " int i;"
5800$ WS " for (i = 0; i < n; i++) {"
5801$ WS " u = u << 1 | (''uvtype')1;"
5802$ WS " if ((''uvtype')(''nvtype')u != u)"
5803$ WS " break;"
5804$ WS " }"
5805$ WS " printf(""%d\n"", i);"
7558ebc2
PP
5806$ WS " exit(0);"
5807$ WS "}"
570bb66e
JH
5808$ CS
5809$ GOSUB compile
a5bd55ee
CB
5810$ nv_preserves_uv_bits = tmp
5811$ IF F$INTEGER(nv_preserves_uv_bits) .GE. (F$INTEGER(uvsize) * 8)
5812$ THEN
570bb66e 5813$ d_nv_preserves_uv = "define"
a5bd55ee 5814$ echo "Your NVs can preserve all ''nv_preserves_uv_bits' bits of your UVs."
570bb66e 5815$ ELSE
a2ea9adf 5816$ d_nv_preserves_uv = "undef"
a5bd55ee 5817$ echo "Your NVs can preserve only ''nv_preserves_uv_bits' bits of your UVs."
570bb66e 5818$ ENDIF
f2610a60 5819$!
1e74786a
CB
5820$ nv_overflows_integers_at = "0"
5821$ echo4 "Checking to find the largest integer value your NVs can hold..."
5822$ OS
5823$ WS "#include <stdio.h>"
5824$ WS ""
5825$ WS "typedef ''nvtype' NV;"
5826$ WS ""
5827$ WS "int"
5828$ WS "main() {"
5829$ WS " NV value = 2;"
5830$ WS " int count = 1;"
5831$ WS ""
5832$ WS " while(count < 256) {"
5833$ WS " volatile NV up = value + 1.0;"
5834$ WS " volatile NV negated = -value;"
5835$ WS " volatile NV down = negated - 1.0;"
5836$ WS " volatile NV got_up = up - value;"
5837$ WS " int up_good = got_up == 1.0;"
5838$ WS " int got_down = down - negated;"
5839$ WS " int down_good = got_down == -1.0;"
5840$ WS ""
5841$ WS " if (down_good != up_good) {"
5842$ WS " fprintf(stderr,"
5843$ WS " ""Inconsistency - up %d %f; down %d %f; for 2**%d (%.20f)\n"","
5844$ WS " up_good, (double) got_up, down_good, (double) got_down,"
5845$ WS " count, (double) value);"
5846$ WS " return 1;"
5847$ WS " }"
5848$ WS " if (!up_good) {"
5849$ WS " while (1) {"
5850$ WS " if (count > 8) {"
5851$ WS " count -= 8;"
5852$ WS " fputs(""256.0"", stdout);"
5853$ WS " } else {"
5854$ WS " count--;"
5855$ WS " fputs(""2.0"", stdout);"
5856$ WS " }"
5857$ WS " if (!count) {"
5858$ WS " puts("""");"
5859$ WS " return 0;"
5860$ WS " }"
5861$ WS " fputs(""*"", stdout);"
5862$ WS " }"
5863$ WS " }"
5864$ WS " value *= 2;"
5865$ WS " ++count;"
5866$ WS " }"
5867$ WS " fprintf(stderr, ""Cannot overflow integer range, even at 2**%d (%.20f)\n"","
5868$ WS " count, (double) value);"
5869$ WS " return 1;"
5870$ WS "}"
5871$ CS
5872$ GOSUB compile
5873$ IF F$LENGTH(tmp) .GT. 0
5874$ THEN
5875$ IF F$EXTRACT(0,1,tmp) .EQS. "2"
5876$ THEN
5877$ echo "The largest integer your NVs can preserve is equal to ''tmp'"
5878$ nv_overflows_integers_at = tmp
5879$ ELSE
5880$ echo "Cannot determine the largest integer value your NVs can hold, unexpected output"
5881$ echo "''tmp'"
5882$ ENDIF
5883$ ELSE
5884$ echo "Cannot determine the largest integer value your NVs can hold"
5885$ ENDIF
5886$!
50ddda1d
CB
5887$! Check for signbit (must already know nvtype)
5888$!
5889$ echo4 "Checking to see if you have signbit() available to work on ''nvtype'..."
5890$ OS
5891$ WS "#if defined(__DECC) || defined(__DECCXX)"
5892$ WS "#include <stdlib.h>"
5893$ WS "#endif"
5894$ WS "#include <fp.h>"
5895$ WS "#include <stdio.h>"
5896$ WS "int main()"
5897$ WS "{"
5898$ WS " ''nvtype' x = 0.0;"
5899$ WS " ''nvtype' y = -0.0;"
5900$ WS " if ((signbit(x) == 0) && (signbit(y) != 0))"
5901$ WS " printf(""1\n"");"
5902$ WS " else"
5903$ WS " printf(""0\n"");"
5904$ WS "}"
5905$ CS
5906$ GOSUB compile
5907$ IF tmp .EQS. "1"
5908$ THEN
5909$ d_signbit = "define"
5910$ echo4 "Yes."
5911$ ELSE
5912$ d_signbit = "undef"
5913$ echo4 "Nope."
5914$ ENDIF
5915$!
db76cb3c
CB
5916$ echo4 "Checking if kill() uses SYS$FORCEX, can't be called from a signal handler,"
5917$ echo4 "or fails to handle a signal value of zero..."
f2610a60
CL
5918$ kill_by_sigprc = "undef"
5919$ OS
5920$ WS "#include <stdio.h>"
5921$ WS "#include <signal.h>"
37a3cbe4 5922$ WS "#include <unistd.h>"
05c058bc
CB
5923$ WS "void handler1(int s) { printf(""%d"",s); kill(getpid(),2); }"
5924$ WS "void handler2(int s) { printf(""%d"",s); }"
f2610a60
CL
5925$ WS "main(){"
5926$ WS " printf(""0"");"
05c058bc
CB
5927$ WS " signal(1,handler1);"
5928$ WS " signal(2,handler2);"
5929$ WS " kill(getpid(),1);"
5930$ WS " sleep(1);"
db76cb3c
CB
5931$ WS " kill(getpid(),0);"
5932$ WS " printf(""3\n"");"
f2610a60
CL
5933$ WS "}"
5934$ CS
5935$ ON ERROR THEN CONTINUE
5936$ GOSUB compile
db76cb3c 5937$ IF tmp .NES. "0123"
f2610a60 5938$ THEN
05c058bc
CB
5939$ echo4 "Yes, it has at least one of those limitations."
5940$ echo4 "Checking whether we can use SYS$SIGPRC instead..."
f2610a60
CL
5941$ OS
5942$ WS "#include <stdio.h>"
5943$ WS "#include <lib$routines.h>"
5944$ WS "unsigned long code = 0;"
85fac3a9
CB
5945$ WS "#define sys$sigprc SYS$SIGPRC"
5946$ WS "#ifdef __cplusplus"
5947$ WS "extern ""C"" {"
5948$ WS "#endif"
5949$ WS " int sys$sigprc(unsigned int *,void *,unsigned int);"
5950$ WS "#ifdef __cplusplus"
5951$ WS "}"
5952$ WS "#endif"
f2610a60
CL
5953$ WS "int handler(unsigned long *args) {"
5954$ WS " code = args[1];"
5955$ WS " return 1;"
5956$ WS "}"
5957$ WS "main() { "
85fac3a9 5958$ WS " int iss;"
f2610a60
CL
5959$ WS " lib$establish(handler);"
5960$ WS " iss = sys$sigprc(0,0,0x1234);"
5961$ WS " iss = ((iss&1)==1 && code == 0x1234);"
5962$ WS " printf(""%d\n"",iss);"
5963$ WS "}"
5964$ CS
dfc1d888
CB
5965$ ON ERROR THEN CONTINUE
5966$ GOSUB compile
f2610a60
CL
5967$ IF tmp .EQS. "1"
5968$ THEN
5cda9808 5969$ echo4 "Yep, we can."
f2610a60
CL
5970$ kill_by_sigprc = "define"
5971$!
5cda9808
CB
5972$ ELSE
5973$ echo4 "Nope, we can't."
f2610a60 5974$ ENDIF
5cda9808
CB
5975$ ELSE
5976$ echo4 "Nope, it doesn't."
f2610a60 5977$ ENDIF
570bb66e
JH
5978$ DELETE/SYMBOL tmp
5979$!
570bb66e
JH
5980$! Finally the composite ones. All config
5981$!
5982$ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
5983$!
414b89cc 5984$ IF ccname .EQS. "DEC"
570bb66e 5985$ THEN
a71134cc 5986$ ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
570bb66e 5987$ ENDIF
414b89cc 5988$ IF ccname .EQS. "CXX"
7558ebc2 5989$ THEN
a71134cc 5990$ ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
7558ebc2 5991$ ENDIF
570bb66e
JH
5992$ IF use_vmsdebug_perl
5993$ THEN
a71134cc 5994$ optimize="/List/Debug/NoOpt"
31963e90 5995$ ldflags="/Debug/Trace/Map"
570bb66e
JH
5996$ dbgprefix = "DBG"
5997$ ELSE
a71134cc 5998$ optimize= "/NoList"
31963e90 5999$ ldflags="/NoTrace/NoMap"
570bb66e
JH
6000$ dbgprefix = ""
6001$ ENDIF
6002$!
6003$! Okay, we've got everything configured. Now go write out a config.sh.
6004$ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
6005$ echo4 "Creating ''basename_config_sh'..."
7558ebc2 6006$ open/write CONFIG 'config_sh'
570bb66e
JH
6007$ WC := write CONFIG
6008$!
6009$! ##BEGIN WRITE NEW CONSTANTS HERE##
6010$!
6011$ WC "#!/bin/sh"
6012$ WC "#"
6013$ WC "# This file was produced by Configure.COM on a ''osname' system."
6014$ WC "#"
6015$ WC "# Package name : ''package'"
6016$ WC "# Source directory : ''src'"
6017$ WC "# Configuration time: " + cf_time
6018$ WC "# Configuration by : " + cf_by
6019$ WC "# Target system : " + myuname
6020$ WC ""
570bb66e
JH
6021$ WC "Makefile_SH='" + Makefile_SH + "'"
6022$ WC "Mcc='" + Mcc + "'"
414b89cc
CB
6023$ WC "PERL_REVISION='" + revision + "'"
6024$ WC "PERL_VERSION='" + patchlevel + "'"
6025$ WC "PERL_SUBVERSION='" + subversion + "'"
30629e9c 6026$ WC "PERL_API_REVISION='" + api_revision + "'"
414b89cc
CB
6027$ WC "PERL_API_VERSION='" + api_version + "'"
6028$ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
c4ac6101 6029$ WC "PERL_PATCHLEVEL='" + perl_patchlevel + "'"
14c175ff 6030$ WC "perl_patchlevel='" + perl_patchlevel + "'"
8c541774 6031$ WC "PERL_CONFIG_SH='true'"
002721d5 6032$ WC "_a='" + lib_ext + "'"
45e8d1dd 6033$ WC "_exe='" + exe_ext + "'"
002721d5 6034$ WC "_o='" + obj_ext + "'"
9d875cfd
CB
6035$ WC "afs='undef'"
6036$ WC "afsroot='/afs'"
570bb66e 6037$ WC "alignbytes='" + alignbytes + "'"
414b89cc 6038$ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
614391c8
CB
6039$ WC "api_revision='" + api_revision + "'"
6040$ WC "api_subversion='" + api_subversion + "'"
6041$ WC "api_version='" + api_version + "'"
6042$ WC "api_versionstring='" + version + "'"
570bb66e
JH
6043$ WC "ar='" + "'"
6044$ WC "archlib='" + archlib + "'"
6045$ WC "archlibexp='" + archlibexp + "'"
6046$ WC "archname='" + archname + "'"
6047$ WC "baserev='" + baserev + "'"
6048$ WC "bin='" + bin + "'"
6049$ WC "binexp='" + binexp + "'"
9d1a8da0 6050$ WC "bootstrap_charset='undef'"
570bb66e
JH
6051$ WC "builddir='" + builddir + "'"
6052$ WC "byteorder='1234'"
6053$ WC "castflags='0'"
6054$ WC "cc='" + perl_cc + "'"
6055$ WC "cccdlflags='" + cccdlflags + "'"
6056$ WC "ccdlflags='" + ccdlflags + "'"
e0261ef8
CB
6057$ IF uselargefiles .OR. uselargefiles .EQS. "define"
6058$ THEN
cfcfe586
JM
6059$ IF usestdstat .OR. usestdstat .EQS. "define"
6060$ THEN
6061$ ccdefines = "_USE_STD_STAT=1"
6062$ ELSE
96021e87 6063$ ccdefines = "_LARGEFILE=1"
cfcfe586 6064$ ENDIF
cc57629d
CB
6065$ ELSE
6066$ ccdefines = ""
96021e87
JM
6067$ ENDIF
6068$ IF ccdefines .NES. ""
6069$ THEN
6070$ WC "ccflags='" + ccflags + "/Define=" + ccdefines + "'"
e0261ef8
CB
6071$ ELSE
6072$ WC "ccflags='" + ccflags + "'"
6073$ ENDIF
6074$ WC "ccflags_uselargefiles='" + "'"
414b89cc 6075$ WC "ccname='" + ccname + "'"
7558ebc2 6076$ WC "ccversion='" + ccversion + "'"
570bb66e
JH
6077$ WC "cf_by='" + cf_by + "'"
6078$ WC "cf_email='" + cf_email + "'"
6079$ WC "cf_time='" + cf_time + "'"
c193ef60 6080$ WC "charbits='8'"
570bb66e
JH
6081$ WC "config_args='" + config_args + "'"
6082$ WC "config_sh='" + config_sh + "'"
6083$ WC "cpp_stuff='" + cpp_stuff + "'"
6084$ WC "cpplast='" + cpplast + "'"
6085$ WC "cppminus='" + cppminus + "'"
6086$ WC "cpprun='" + cpprun + "'"
6087$ WC "cppstdin='" + cppstdin + "'"
79f41ce5
CB
6088$ IF use64bitint .OR. use64bitint .EQS. "define"
6089$ THEN
6090$! gcvt() does not work for > 16 decimal places; fallback to sprintf
6091$ WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
6092$ ELSE
9fd42072 6093$ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
79f41ce5 6094$ ENDIF
d677d0fc
CB
6095$ WC "d_PRIEUldbl='" + d_PRIEUldbl + "'"
6096$ WC "d_PRIFUldbl='" + d_PRIFUldbl + "'"
6097$ WC "d_PRIGUldbl='" + d_PRIGUldbl + "'"
842bcadf 6098$ WC "d_PRIXU64='" + d_PRIXU64 + "'"
2ef53570 6099$ WC "d_PRId64='" + d_PRId64 + "'"
59a27e12 6100$ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
570bb66e
JH
6101$ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
6102$ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
186abd56 6103$ WC "d_PRIi64='" + d_PRIi64 + "'"
570bb66e
JH
6104$ WC "d_PRIo64='" + d_PRIo64 + "'"
6105$ WC "d_PRIu64='" + d_PRIu64 + "'"
6106$ WC "d_PRIx64='" + d_PRIx64 + "'"
b5ddfb46 6107$ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
2ef53570 6108$ WC "d__fwalk='undef'"
5c7252f4 6109$ WC "d_accept4='undef'"
570bb66e
JH
6110$ WC "d_access='" + d_access + "'"
6111$ WC "d_accessx='undef'"
40613a90 6112$ WC "d_acosh='" + d_acosh + "'"
e10940c3 6113$ WC "d_aintl='undef'"
570bb66e
JH
6114$ WC "d_alarm='define'"
6115$ WC "d_archlib='define'"
96938616 6116$ WC "d_asctime64='undef'"
a7ed70b3
JH
6117$ WC "d_asinh='" + d_asinh + "'"
6118$ WC "d_atanh='" + d_atanh + "'"
570bb66e
JH
6119$ WC "d_atolf='" + d_atolf + "'"
6120$ WC "d_atoll='" + d_atoll + "'"
e849841d 6121$ WC "d_attribute_always_inline='undef'"
0dbb1585 6122$ WC "d_attribute_format='" + d_attribut + "'"
fcdf39cf 6123$ WC "d_attribute_deprecated='undef'"
0dbb1585
AL
6124$ WC "d_attribute_malloc='undef'"
6125$ WC "d_attribute_nonnull='undef'"
6126$ WC "d_attribute_noreturn='undef'"
6127$ WC "d_attribute_pure='undef'"
6128$ WC "d_attribute_unused='undef'"
6129$ WC "d_attribute_warn_unused_result='undef'"
8f13cdc7
MB
6130$ WC "d_prctl='undef'"
6131$ WC "d_prctl_set_name='undef'"
36f1aec4 6132$ WC "d_printf_format_null='undef'"
570bb66e 6133$ WC "d_bincompat3='undef'"
c487cd5b 6134$ WC "d_bsd='undef'"
2ef53570 6135$ WC "d_bsdgetpgrp='undef'"
570bb66e 6136$ WC "d_bsdsetpgrp='undef'"
e8e09534
PP
6137$ WC "d_builtin_choose_expr='undef'" ! GCC only
6138$ WC "d_builtin_expect='undef'" ! GCC only
c94a4d04
MB
6139$ WC "d_builtin_add_overflow='undef'" ! GCC only
6140$ WC "d_builtin_mul_overflow='undef'" ! GCC only
6141$ WC "d_builtin_sub_overflow='undef'" ! GCC only
570bb66e
JH
6142$ WC "d_casti32='define'"
6143$ WC "d_castneg='define'"
a7ed70b3 6144$ WC "d_cbrt='" + d_cbrt + "'"
570bb66e
JH
6145$ WC "d_chown='define'"
6146$ WC "d_chroot='undef'"
6147$ WC "d_chsize='undef'"
758a5d79 6148$ WC "d_class='undef'"
c487cd5b 6149$ WC "d_closedir='define'"
570bb66e 6150$ WC "d_cmsghdr_s='undef'"
a7ed70b3 6151$ WC "d_copysign='" + d_copysign + "'"
e10940c3 6152$ WC "d_copysignl='define'"
60f153db 6153$ WC "d_cplusplus='" + d_cplusplus + "'"
570bb66e
JH
6154$ WC "d_crypt='define'"
6155$ WC "d_csh='undef'"
0b57cc8d 6156$ WC "d_ctermid='define'"
96938616 6157$ WC "d_ctime64='undef'"
570bb66e 6158$ WC "d_cuserid='define'"
9802685f 6159$ WC "d_c99_variadic_macros='undef'"
570bb66e 6160$ WC "d_dbl_dig='define'"
2ef53570 6161$ WC "d_dbminitproto='undef'"
570bb66e 6162$ WC "d_difftime='define'"
96938616 6163$ WC "d_difftime64='undef'"
de52168c 6164$ WC "d_dir_dd_fd='undef'"
a838cfe5 6165$ WC "d_dirfd='undef'"
ddcbaa1c 6166$ WC "d_dirnamlen='define'"
470dd224 6167$ WC "d_dladdr='undef'"
c487cd5b
CB
6168$ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."7.2")
6169$ THEN
6170$ WC "d_dlerror='define'"
6171$ WC "d_dlopen='define'"
6172$ ELSE
6173$ WC "d_dlerror='undef'"
6174$ WC "d_dlopen='undef'"
6175$ ENDIF
570bb66e 6176$ WC "d_dlsymun='undef'"
470dd224 6177$ WC "d_backtrace='undef'"
570bb66e 6178$ WC "d_dosuid='undef'"
4cb05021
JH
6179$ WC "d_double_has_inf='" + d_double_has_inf + "'"
6180$ WC "d_double_has_nan='" + d_double_has_nan + "'"
6181$ WC "d_double_has_negative_zero='" + d_double_has_negative_zero + "'"
6182$ WC "d_double_has_subnormals='" + d_double_has_subnormals + "'"
6183$ WC "d_double_style_cray='undef'"
6184$ WC "d_double_style_ibm='undef'"
6185$ WC "d_double_style_ieee='" + d_double_style_ieee + "'"
6186$ WC "d_double_style_vax='" + d_double_style_vax + "'"
570bb66e
JH
6187$ WC "d_drand48proto='" + d_drand48proto + "'"
6188$ WC "d_dup2='define'"
5c7252f4 6189$ WC "d_dup3='undef'"
354810ee 6190$ WC "d_duplocale='undef'"
570bb66e
JH
6191$ WC "d_eaccess='undef'"
6192$ WC "d_endgrent='define'"
6193$ WC "d_endhent='" + d_endhent + "'"
6194$ WC "d_endnent='" + d_endnent + "'"
6195$ WC "d_endpent='" + d_endpent + "'"
6196$ WC "d_endpwent='define'"
6197$ WC "d_endsent='" + d_endsent + "'"
6198$ WC "d_eofnblk='undef'"
a7ed70b3
JH
6199$ WC "d_erf='" + d_erf + "'"
6200$ WC "d_erfc='" + d_erfc + "'"
570bb66e 6201$ WC "d_eunice='undef'"
a7ed70b3
JH
6202$ WC "d_exp2='" + d_exp2 + "'"
6203$ WC "d_expm1='" + d_expm1 + "'"
669d6ad8
CB
6204$ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."8.3")
6205$ THEN
6206$ WC "d_fchmod='define'"
6207$ ELSE
6208$ WC "d_fchmod='undef'"
6209$ ENDIF
b363b713 6210$ WC "d_fchdir='undef'"
669d6ad8 6211$ WC "d_fchown='define'"
570bb66e 6212$ WC "d_fcntl='" + d_fcntl + "'"
1c21a19a 6213$ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
570bb66e 6214$ WC "d_fd_set='" + d_fd_set + "'"
06fb617f 6215$ WC "d_fd_macros='define'"
8b8c6ab7 6216$ WC "d_fdclose='undef'"
a7ed70b3 6217$ WC "d_fdim='" + d_fdim + "'"
06fb617f 6218$ WC "d_fds_bits='define'"
2f6b96eb 6219$ WC "d_fegetround='undef'"
7db2b62c
KW
6220$ WC "d_ffs='undef'"
6221$ WC "d_ffsl='undef'"
570bb66e 6222$ WC "d_fgetpos='define'"
054a3baf 6223$ IF use_ieee_math
c6c7826a
CB
6224$ THEN
6225$ WC "d_finite='define'"
6226$ WC "d_finitel='define'"
6227$ ELSE
6228$ WC "d_finite='undef'"
6229$ WC "d_finitel='undef'"
6230$ ENDIF
570bb66e
JH
6231$ WC "d_flexfnam='define'"
6232$ WC "d_flock='undef'"
2ef53570 6233$ WC "d_flockproto='undef'"
a7ed70b3
JH
6234$ WC "d_fma='" + d_fma + "'"
6235$ WC "d_fmax='" + d_fmax + "'"
6236$ WC "d_fmin='" + d_fmin + "'"
570bb66e 6237$ WC "d_fork='undef'"
758a5d79 6238$ WC "d_fp_class='undef'"
f6ea46e0 6239$ WC "d_fp_classify='" + d_fp_classify + "'"
add06237 6240$ WC "d_fp_classify='undef'"
b19ee02c 6241$ WC "d_fp_classl='undef'"
570bb66e 6242$ WC "d_fpathconf='" + d_fpathconf + "'"
758a5d79 6243$ WC "d_fpclass='undef'"
6568ef82 6244$ WC "d_fpclassify='" + d_fpclassify + "'"
758a5d79 6245$ WC "d_fpclassl='undef'"
4c1a9b0c 6246$ WC "d_fpgetround='undef'"
570bb66e
JH
6247$ WC "d_fpos64_t='" + d_fpos64_t + "'"
6248$ WC "d_frexpl='" + d_frexpl + "'"
ea442100 6249$ WC "d_fs_data_s='undef'"
e0261ef8 6250$ WC "d_fseeko='" + d_fseeko + "'"
570bb66e 6251$ WC "d_fsetpos='define'"
ea442100
JH
6252$ WC "d_fstatfs='undef'"
6253$ WC "d_fstatvfs='" + d_fstatvfs + "'"
0bb6ccda 6254$ WC "d_fsync='define'"
e0261ef8 6255$ WC "d_ftello='" + d_ftello + "'"
06fb617f 6256$ WC "d_ftime='define'"
eca5cfc5 6257$ WC "d_futimes='undef'"
36ba69be
CB
6258$ WC "d_gdbmndbm_h_uses_prototypes='undef'"
6259$ WC "d_gdbm_ndbm_h_uses_prototypes='undef'"
054a3baf 6260$ WC "d_getaddrinfo='define'"
fea629d8 6261$ WC "d_getcwd='define'"
570bb66e 6262$ WC "d_getespwnam='undef'"
ea442100 6263$ WC "d_getfsstat='undef'"
570bb66e
JH
6264$ WC "d_getgrent='define'"
6265$ WC "d_getgrps='undef'"
6266$ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
6267$ WC "d_gethbyname='" + d_gethbyname + "'"
6268$ WC "d_gethent='" + d_gethent + "'"
6269$ WC "d_gethname='" + d_gethname + "'"
6270$ WC "d_gethostprotos='" + d_gethostprotos + "'"
10eefe7f 6271$ WC "d_getitimer='" + d_getitimer + "'"
570bb66e 6272$ WC "d_getlogin='define'"
ea442100
JH
6273$ WC "d_getmnt='undef'"
6274$ WC "d_getmntent='undef'"
054a3baf 6275$ WC "d_getnameinfo='define'"
570bb66e
JH
6276$ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
6277$ WC "d_getnbyname='" + d_getnbyname + "'"
6278$ WC "d_getnent='" + d_getnent + "'"
6279$ WC "d_getnetprotos='" + d_getnetprotos + "'"
0c0643d0 6280$ WC "d_getpagsz='undef'"
570bb66e
JH
6281$ WC "d_getpbyname='" + d_getpbyname + "'"
6282$ WC "d_getpbynumber='" + d_getpbynumber + "'"
6283$ WC "d_getpent='" + d_getpent + "'"
96021e87 6284$ WC "d_getpgid='" + d_getpgid + "'"
570bb66e 6285$ WC "d_getpgrp2='undef'"
96021e87 6286$ WC "d_getpgrp='" + d_getpgrp + "'"
41cbbefa 6287$ WC "d_getppid='" + d_getppid + "'"
570bb66e
JH
6288$ WC "d_getprior='undef'"
6289$ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
6290$ WC "d_getprpwnam='undef'"
6291$ WC "d_getpwent='define'"
6292$ WC "d_getsbyname='" + d_getsbyname + "'"
6293$ WC "d_getsbyport='" + d_getsbyport + "'"
6294$ WC "d_getsent='" + d_getsent + "'"
6295$ WC "d_getservprotos='" + d_getservprotos + "'"
6296$ WC "d_getspnam='undef'"
6297$ WC "d_gettimeod='" + d_gettimeod + "'"
96938616 6298$ WC "d_gmtime64='undef'"
570bb66e
JH
6299$ WC "d_gnulibc='undef'"
6300$ WC "d_grpasswd='undef'"
ea442100 6301$ WC "d_hasmntopt='undef'"
570bb66e 6302$ WC "d_htonl='" + d_htonl + "'"
a7ed70b3
JH
6303$ WC "d_hypot='" + d_hypot + "'"
6304$ WC "d_ilogb='" + d_ilogb + "'"
e10940c3 6305$ WC "d_ilogbl='undef'"
a04d9d89 6306$ WC "d_inc_version_list='undef'"
570bb66e 6307$ WC "d_index='" + d_index + "'"
744841cb
CB
6308$ WC "d_inetaton='define'"
6309$ WC "d_inetntop='define'"
6310$ WC "d_inetpton='define'"
570bb66e 6311$ WC "d_int64_t='" + d_int64_t + "'"
122b9bf4 6312$ WC "d_ip_mreq='define'"
3e06601f 6313$ WC "d_ip_mreq_source='undef'"
fd3bef80 6314$ WC "d_ipv6_mreq='define'"
3e06601f 6315$ WC "d_ipv6_mreq_source='undef'"
570bb66e 6316$ WC "d_isascii='define'"
6568ef82 6317$ WC "d_isblank='" + d_isblank + "'"
f88c7f62 6318$ WC "d_isfinite='undef'"
fa484e60 6319$ WC "d_isfinitel='undef'"
758a5d79 6320$ WC "d_isinf='undef'"
fa484e60 6321$ WC "d_isinfl='undef'"
6568ef82 6322$ WC "d_isless='" + d_isless + "'"
3a491987 6323$ WC "d_isnan='" + d_isnan + "'"
570bb66e 6324$ WC "d_isnanl='" + d_isnanl + "'"
a7ed70b3 6325$ WC "d_isnormal='" + d_isnormal + "'"
4671125a
JH
6326$ WC "d_j0='" + d_j0 + "'"
6327$ WC "d_j0l='undef'"
96f902ff 6328$ WC "d_killpg='define'"
96021e87 6329$ WC "d_lchown='" + d_lchown + "'"
570bb66e 6330$ WC "d_ldbl_dig='define'"
688e39e5 6331$ WC "d_ldexpl='" + d_ldexpl + "'"
a7ed70b3 6332$ WC "d_lgamma='" + d_lgamma + "'"
5b55c156 6333$ WC "d_libm_lib_version='undef'"
96021e87 6334$ WC "d_link='" + d_link + "'"
6568ef82
CB
6335$ WC "d_llrint='" + d_llrint + "'"
6336$ WC "d_llrintl='" + d_llrintl + "'"
6337$ WC "d_llround='" + d_llround + "'"
6338$ WC "d_llroundl='" + d_llroundl + "'"
570bb66e 6339$ WC "d_llseek='undef'"
c94a4d04 6340$ WC "d_localeconv_l='undef'"
96938616 6341$ WC "d_localtime64='undef'"
570bb66e 6342$ WC "d_locconv='" + d_locconv + "'"
04518420 6343$ WC "d_lc_monetary_2008='undef'"
570bb66e 6344$ WC "d_lockf='undef'"
a7ed70b3
JH
6345$ WC "d_log1p='" + d_log1p + "'"
6346$ WC "d_log2='" + d_log2 + "'"
6347$ WC "d_logb='" + d_logb + "'"
4cb05021
JH
6348$ WC "d_long_double_style_ieee='" + d_long_double_style_ieee + "'"
6349$ WC "d_long_double_style_ieee_doubledouble='undef'"
6350$ WC "d_long_double_style_ieee_extended='" + d_long_double_style_ieee_extended + "'"
6351$ WC "d_long_double_style_ieee_std='" + d_long_double_style_ieee_std + "'"
6352$ WC "d_long_double_style_vax='" + d_long_double_style_vax + "'"
570bb66e
JH
6353$ WC "d_longdbl='" + d_longdbl + "'"
6354$ WC "d_longlong='" + d_longlong + "'"
a7ed70b3 6355$ WC "d_lrint='" + d_lrint + "'"
bc580dd3 6356$ WC "d_lrintl='" + d_lrintl + "'"
a7ed70b3 6357$ WC "d_lround='" + d_lround + "'"
bc580dd3 6358$ WC "d_lroundl='" + d_lroundl + "'"
570bb66e 6359$ WC "d_lseekproto='define'"
96021e87 6360$ WC "d_lstat='" + d_lstat + "'"
570bb66e 6361$ WC "d_madvise='undef'"
2b339242
JM
6362$ WC "d_malloc_size='undef'"
6363$ WC "d_malloc_good_size='undef'"
570bb66e 6364$ WC "d_mblen='" + d_mblen + "'"
99fdfa85
CB
6365$ WC "d_mbrlen='define'"
6366$ WC "d_mbrtowc='define'"
570bb66e
JH
6367$ WC "d_mbstowcs='" + d_mbstowcs + "'"
6368$ WC "d_mbtowc='" + d_mbtowc + "'"
3879c54d 6369$ WC "d_memmem='undef'"
4ff4a40a 6370$ WC "d_memrchr='" + d_memrchr + "'"
570bb66e
JH
6371$ WC "d_mkdir='define'"
6372$ WC "d_mkdtemp='" + d_mkdtemp + "'"
6373$ WC "d_mkfifo='undef'"
6374$ WC "d_mknod='undef'"
226394c3 6375$ WC "d_mkostemp='undef'"
570bb66e
JH
6376$ WC "d_mkstemp='" + d_mkstemp + "'"
6377$ WC "d_mkstemps='" + d_mkstemps + "'"
6378$ WC "d_mktime='" + d_mktime + "'"
96938616 6379$ WC "d_mktime64='undef'"
10eefe7f 6380$ WC "d_mmap='" + d_mmap + "'"
570bb66e 6381$ WC "d_modfl='" + d_modfl + "'"
8725ccc4 6382$ WC "d_modflproto='" + d_modflproto + "'"
7b826da8 6383$ WC "d_modfl_pow32_bug='undef'"
10eefe7f 6384$ WC "d_mprotect='" + d_mprotect + "'"
570bb66e 6385$ WC "d_msg='undef'"
c487cd5b
CB
6386$ WC "d_msgctl='undef'"
6387$ WC "d_msgget='undef'"
6388$ WC "d_msgrcv='undef'"
6389$ WC "d_msgsnd='undef'"
570bb66e
JH
6390$ WC "d_msg_ctrunc='undef'"
6391$ WC "d_msg_dontroute='undef'"
6392$ WC "d_msg_oob='undef'"
6393$ WC "d_msg_peek='undef'"
6394$ WC "d_msg_proxy='undef'"
6395$ WC "d_msghdr_s='undef'"
10eefe7f
CB
6396$ WC "d_msync='" + d_msync + "'"
6397$ WC "d_munmap='" + d_munmap + "'"
570bb66e 6398$ WC "d_mymalloc='" + d_mymalloc + "'"
a7ed70b3 6399$ WC "d_nan='undef'"
02e1c2f1 6400$ WC "d_nanosleep='" + d_nanosleep + "'"
06fb617f 6401$ WC "d_ndbm='undef'"
36ba69be 6402$ WC "d_ndbm_h_uses_prototypes='undef'"
6568ef82 6403$ WC "d_nearbyint='" + d_nearbyint + "'"
a7ed70b3
JH
6404$ WC "d_nextafter='" + d_nextafter + "'"
6405$ WC "d_nexttoward='" + d_nexttoward + "'"
570bb66e 6406$ WC "d_nice='define'"
2765b840 6407$ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
7db2b62c 6408$ WC "d_nl_langinfo_l='undef'"
bfe51271 6409$ WC "d_non_int_bitfields='define'"
9d228af7 6410$ WC "d_getenv_preserves_other_thread='" + d_getenv_preserves_other_thread + "'"
570bb66e 6411$ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
1e74786a 6412$ WC "nv_overflows_integers_at='" + nv_overflows_integers_at + "'"
53133ed1 6413$ WC "nv_preserves_uv_bits='" + nv_preserves_uv_bits + "'"
f607920a 6414$ WC "d_nv_zero_is_allbits_zero='define'"
570bb66e
JH
6415$ WC "d_off64_t='" + d_off64_t + "'"
6416$ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
6417$ WC "d_oldarchlib='define'"
6418$ WC "d_oldpthreads='" + d_oldpthreads + "'"
06fb617f 6419$ WC "d_oldsock='undef'"
570bb66e 6420$ WC "d_open3='define'"
d226c0a2
TC
6421$ WC "d_openat='undef'"
6422$ WC "d_unlinkat='undef'"
6423$ WC "d_renameat='undef'"
6424$ WC "d_linkat='undef'"
6425$ WC "d_fchmodat='undef'"
570bb66e
JH
6426$ WC "d_pathconf='" + d_pathconf + "'"
6427$ WC "d_pause='define'"
6428$ WC "d_perl_otherlibdirs='undef'"
414b89cc 6429$ WC "d_phostname='" + d_phostname + "'"
570bb66e 6430$ WC "d_pipe='define'"
5c7252f4 6431$ WC "d_pipe2='undef'"
d2d53deb 6432$ WC "d_poll='" + d_poll + "'"
06fb617f 6433$ WC "d_portable='define'"
e9a8643a 6434$ WC "d_procselfexe='undef'"
734e0e83 6435$ WC "d_pseudofork='undef'"
d6483fcc 6436$ WC "d_pthread_atfork='undef'"
e0e3c57a 6437$ WC "d_pthread_attr_setscope='" + d_pthread_attr_setscope + "'"
570bb66e
JH
6438$ WC "d_pthread_yield='" + d_pthread_yield + "'"
6439$ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
d0b86e2f 6440$ WC "d_ptrdiff_t='define'"
570bb66e
JH
6441$ WC "d_pwage='undef'"
6442$ WC "d_pwchange='undef'"
6443$ WC "d_pwclass='undef'"
6444$ WC "d_pwcomment='define'"
6445$ WC "d_pwexpire='undef'"
6446$ WC "d_pwgecos='define'"
6447$ WC "d_pwpasswd='define'"
6448$ WC "d_pwquota='undef'"
6449$ WC "d_qgcvt='undef'"
6450$ WC "d_quad='" + d_quad + "'"
354810ee 6451$ WC "d_re_comp='undef'"
570bb66e 6452$ WC "d_readdir='define'"
96021e87 6453$ WC "d_readlink='" + d_readlink + "'"
8f622c38 6454$ WC "d_readv='define'"
96021e87 6455$ WC "d_realpath='" + d_realpath + "'"
408956da 6456$ WC "d_recvmsg='define'"
354810ee 6457$ WC "d_regcmp='undef'"
f40bbcbf 6458$ WC "d_regcomp='undef'"
a7ed70b3
JH
6459$ WC "d_remainder='" + d_remainder + "'"
6460$ WC "d_remquo='" + d_remquo + "'"
570bb66e
JH
6461$ WC "d_rename='define'"
6462$ WC "d_rewinddir='define'"
a7ed70b3 6463$ WC "d_rint='" + d_rint + "'"
570bb66e 6464$ WC "d_rmdir='define'"
6568ef82 6465$ WC "d_round='" + d_round + "'"
414b89cc 6466$ WC "d_sbrkproto='define'"
6568ef82
CB
6467$ WC "d_scalbn='" + d_scalbn + "'"
6468$ WC "d_scalbnl='" + d_scalbnl + "'"
570bb66e
JH
6469$ WC "d_sched_yield='" + d_sched_yield + "'"
6470$ WC "d_scm_rights='undef'"
6471$ WC "d_seekdir='define'"
6472$ WC "d_select='" + d_select + "'"
a429ddf7
CB
6473$ IF ("''F$EXTRACT(1,3, F$GETSYI(""VERSION""))'".GES."8.4")
6474$ THEN
6475$ WC "d_sem='define'"
14fb7316 6476$ WC "d_semctl='define'"
a429ddf7
CB
6477$ WC "d_semctl_semid_ds='define'"
6478$ WC "d_semctl_semun='define'"
6479$ WC "d_semget='define'"
6480$ WC "d_semop='define'"
6481$ ELSE
6482$ WC "d_sem='undef'"
14fb7316 6483$ WC "d_semctl='undef'"
a429ddf7
CB
6484$ WC "d_semctl_semid_ds='undef'"
6485$ WC "d_semctl_semun='undef'"
6486$ WC "d_semget='undef'"
6487$ WC "d_semop='undef'"
6488$ ENDIF
408956da 6489$ WC "d_sendmsg='define'"
570bb66e
JH
6490$ WC "d_setegid='undef'"
6491$ WC "d_setenv='" + d_setenv + "'"
96021e87
JM
6492$ WC "d_seteuid='" + d_seteuid + "'"
6493$ WC "d_setgrent='" + d_setgrent + "'"
570bb66e
JH
6494$ WC "d_setgrps='undef'"
6495$ WC "d_sethent='" + d_sethent + "'"
10eefe7f 6496$ WC "d_setitimer='" + d_setitimer + "'"
570bb66e
JH
6497$ WC "d_setlinebuf='undef'"
6498$ WC "d_setlocale='" + d_setlocale + "'"
2e3ef32f 6499$ WC "d_setlocale_accepts_any_locale_name='" + d_setlocale_accepts_any_locale_name + "'"
570bb66e
JH
6500$ WC "d_setnent='" + d_setnent + "'"
6501$ WC "d_setpent='" + d_setpent + "'"
96021e87 6502$ WC "d_setpgid='" + d_setpgid + "'"
570bb66e 6503$ WC "d_setpgrp2='undef'"
96021e87 6504$ WC "d_setpgrp='" + d_setpgrp + "'"
570bb66e
JH
6505$ WC "d_setprior='undef'"
6506$ WC "d_setproctitle='" + d_setproctitle + "'"
6507$ WC "d_setpwent='define'"
96021e87 6508$ WC "d_setregid='" + d_setregid + "'"
570bb66e
JH
6509$ WC "d_setresgid='undef'"
6510$ WC "d_setresuid='undef'"
96021e87 6511$ WC "d_setreuid='" + d_setreuid + "'"
570bb66e
JH
6512$ WC "d_setrgid='undef'"
6513$ WC "d_setruid='undef'"
6514$ WC "d_setsent='" + d_setsent + "'"
96021e87 6515$ WC "d_setsid='" + d_setsid + "'"
570bb66e 6516$ WC "d_setvbuf='" + d_setvbuf + "'"
3f88addd
CB
6517$ WC "d_shm='" + d_shm + "'"
6518$ WC "d_shmat='" + d_shmat + "'"
6519$ WC "d_shmatprototype='" + d_shmatprototype + "'"
6520$ WC "d_shmctl='" + d_shmctl + "'"
6521$ WC "d_shmdt='" + d_shmdt + "'"
6522$ WC "d_shmget='" + d_shmget + "'"
570bb66e 6523$ WC "d_sigaction='" + d_sigaction + "'"
cdfe2e65
DIM
6524$ WC "d_siginfo_si_addr='" + d_siginfo_si_addr + "'"
6525$ WC "d_siginfo_si_band='" + d_siginfo_si_band + "'"
6526$ WC "d_siginfo_si_errno='" + d_siginfo_si_errno + "'"
354810ee 6527$ WC "d_siginfo_si_fd='" + d_siginfo_si_fd + "'"
cdfe2e65
DIM
6528$ WC "d_siginfo_si_pid='" + d_siginfo_si_pid + "'"
6529$ WC "d_siginfo_si_status='" + d_siginfo_si_status + "'"
6530$ WC "d_siginfo_si_uid='" + d_siginfo_si_uid + "'"
6531$ WC "d_siginfo_si_value='" + d_siginfo_si_value + "'"
50ddda1d 6532$ WC "d_signbit='" + d_signbit + "'"
983dbef6 6533$ WC "d_sigprocmask='" + d_sigprocmask + "'"
570bb66e 6534$ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
d9484470 6535$ WC "d_sin6_scope_id='" + d_sin6_scope_id + "'"
a04d9d89 6536$ WC "d_sitearch='define'"
fd3bef80 6537$ WC "d_sockaddr_in6='define'"
234242ca 6538$ WC "d_sockaddr_sa_len='" + d_sockaddr_sa_len + "'"
0a49e948 6539$ WC "d_sockaddr_storage='undef'"
49a78c82 6540$ WC "d_sockatmark='undef'"
2ef53570 6541$ WC "d_sockatmarkproto='undef'"
570bb66e
JH
6542$ WC "d_socket='" + d_socket + "'"
6543$ WC "d_socklen_t='" + d_socklen_t + "'"
96021e87 6544$ WC "d_sockpair='" + d_sockpair + "'"
1b9c9cf5 6545$ WC "d_socks5_init='undef'"
570bb66e 6546$ WC "d_sqrtl='define'"
eef837ea 6547$ WC "d_sresgproto='undef'"
2ef53570
JH
6548$ WC "d_sresgproto='undef'"
6549$ WC "d_sresproto='undef'"
f42f5b4c 6550$ WC "d_sresuproto='undef'"
f40bbcbf 6551$ WC "d_stat='define'"
570bb66e 6552$ WC "d_statblks='undef'"
ea442100
JH
6553$ WC "d_statfs_f_flags='undef'"
6554$ WC "d_statfs_s='undef'"
6555$ WC "d_statfsflags='undef'"
b0e839b3 6556$ WC "d_static_inline='define'"
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'"
570bb66e
JH
6793$ WC "inc_version_list='0'"
6794$ WC "inc_version_list_init='0'"
6795$ WC "installarchlib='" + installarchlib + "'"
6796$ WC "installbin='" + installbin + "'"
6797$ WC "installman1dir='" + installman1dir + "'"
6798$ WC "installman3dir='" + installman3dir + "'"
ec18bc92 6799$ WC "installprefix='" + vms_prefix + "'"
097f20ec 6800$ WC "installprefixexp='/" + vms_prefix + "'"
570bb66e
JH
6801$ WC "installprivlib='" + installprivlib + "'"
6802$ WC "installscript='" + installscript + "'"
6803$ WC "installsitearch='" + installsitearch + "'"
ec18bc92 6804$ WC "installsitebin='" + sitebin + "'"
570bb66e
JH
6805$ WC "installsitelib='" + installsitelib + "'"
6806$ WC "installusrbinperl='undef'"
6807$ WC "intsize='" + intsize + "'"
6808$ WC "ivdformat='" + ivdformat + "'"
6809$ WC "ivsize='" + ivsize + "'"
6810$ WC "ivtype='" + ivtype + "'"
a3bd614a 6811$!
86ad859e 6812$! The xs_extensions symbol may be quite long
a3bd614a 6813$!
86ad859e 6814$ WC/symbol "known_extensions='", xs_extensions, " ", nonxs_ext, " ", nonxs_ext2, "'"
570bb66e 6815$ WC "ld='" + ld + "'"
8e15b544 6816$ WC "ld_can_script='undef'"
570bb66e 6817$ WC "lddlflags='/Share'"
f24fb74c 6818$ WC "ldflags='" + ldflags + "'"
e0261ef8 6819$ WC "ldflags_uselargefiles='" + "'"
8e15b544 6820$ WC "ldlibpthname='" + "'"
570bb66e
JH
6821$ WC "lib_ext='" + lib_ext + "'"
6822$ WC "libc='" + libc + "'"
6823$ WC "libpth='/sys$share /sys$library'"
6824$ WC "libs='" + libs + "'"
e0261ef8
CB
6825$ WC "libswanted='" + "'"
6826$ WC "libswanted_uselargefiles='" + "'"
570bb66e 6827$ WC "longdblsize='" + longdblsize + "'"
dc91db6c 6828$ WC "longdblkind='" + longdblkind + "'"
44521f3a
JH
6829$ WC "longdblinfbytes='" + longdblinfbytes + "'"
6830$ WC "longdblnanbytes='" + longdblnanbytes + "'"
5a14060a 6831$ WC "longdblmantbits='" + longdblmantbits + "'"
570bb66e
JH
6832$ WC "longlongsize='" + longlongsize + "'"
6833$ WC "longsize='" + longsize + "'"
e0261ef8
CB
6834$ IF uselargefiles .OR. uselargefiles .EQS. "define"
6835$ THEN
6836$ WC "lseeksize='8'"
6837$ WC "lseektype='off_t'"
6838$ ELSE
6839$ WC "lseeksize='4'"
6840$ WC "lseektype='int'"
6841$ ENDIF
570bb66e 6842$ WC "mab='" + "'"
a724edfe 6843$ WC "mad='undef'"
570bb66e
JH
6844$ WC "make='" + make + "'"
6845$ WC "malloctype='void *'"
dc8c9d5a 6846$ WC "usemallocwrap='" + usemallocwrap + "'"
570bb66e
JH
6847$ WC "man1ext='rno'"
6848$ WC "man3ext='rno'"
10eefe7f 6849$ WC "mmaptype='void *'"
570bb66e
JH
6850$ WC "modetype='unsigned int'"
6851$ WC "multiarch='undef'"
6852$ WC "mydomain='" + mydomain + "'"
6853$ WC "myhostname='" + myhostname + "'"
6854$ WC "myuname='" + myuname + "'"
2cc61e15 6855$ WC "need_va_copy='undef'"
570bb66e
JH
6856$ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
6857$ WC "netdb_host_type='" + netdb_host_type + "'"
6858$ WC "netdb_name_type='" + netdb_name_type + "'"
6859$ WC "netdb_net_type='" + netdb_net_type + "'"
bd2aeadf 6860$ WC/symbol "nonxs_ext='", nonxs_ext, " ", nonxs_ext2, "'"
fd47df60 6861$ WC "nveformat='" + nveformat + "'"
d677d0fc 6862$ WC "nvEUformat='" + nvEUformat + "'"
fd47df60 6863$ WC "nvfformat='" + nvfformat + "'"
d677d0fc 6864$ WC "nvFUformat='" + nvFUformat + "'"
fd47df60 6865$ WC "nvgformat='" + nvgformat + "'"
d677d0fc 6866$ WC "nvGUformat='" + nvGUformat + "'"
5a14060a 6867$ WC "nvmantbits='" + nvmantbits + "'"
570bb66e
JH
6868$ WC "nvsize='" + nvsize + "'"
6869$ WC "nvtype='" + nvtype + "'"
6870$ WC "o_nonblock=' '"
6871$ WC "obj_ext='" + obj_ext + "'"
6872$ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
6873$ WC "oldarchlib='" + oldarchlib + "'"
6874$ WC "oldarchlibexp='" + oldarchlibexp + "'"
6875$ WC "optimize='" + optimize + "'"
6876$ WC "osname='" + osname + "'"
6877$ WC "osvers='" + osvers + "'"
6878$ WC "otherlibdirs='" + "'"
6879$ WC "package='" + package + "'"
6880$ WC "pager='" + pager + "'"
6881$ WC "patchlevel='" + patchlevel + "'"
6882$ WC "path_sep='|'"
6883$ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
6884$ WC "perladmin='" + perladmin + "'"
94928b12 6885$ WC "perllibs='" + perllibs + "'"
972e9305 6886$ WC "perlpath='" + "''vms_prefix':[000000]Perl''exe_ext'" + "'"
b0e839b3 6887$ WC "perl_static_inline='static inline'"
9b5c8979
JH
6888$ WC "perl_symbol='" + perl_symbol + "'" ! VMS specific
6889$ WC "perl_verb='" + perl_verb + "'" ! VMS specific
570bb66e
JH
6890$ WC "pgflquota='" + pgflquota + "'"
6891$ WC "pidtype='" + pidtype + "'"
70c20b69 6892$ WC "prefix='" + vms_prefix + "'"
097f20ec 6893$ WC "prefixexp='/" + vms_prefix + "'"
570bb66e
JH
6894$ WC "privlib='" + privlib + "'"
6895$ WC "privlibexp='" + privlibexp + "'"
357cef76 6896$ WC "procselfexe=' '"
570bb66e
JH
6897$ WC "prototype='define'"
6898$ WC "ptrsize='" + ptrsize + "'"
6899$ WC "quadkind='" + quadkind + "'"
6900$ WC "quadtype='" + quadtype + "'"
cd3eeb19
CB
6901$ WC "randbits='" + randbits + "'"
6902$ WC "randfunc='" + randfunc + "'"
570bb66e
JH
6903$ WC "randseedtype='" + randseedtype + "'"
6904$ WC "ranlib='" + "'"
6905$ WC "rd_nodata=' '"
6906$ WC "revision='" + revision + "'"
d83484c2 6907$ WC "sGMTIME_max='4294967295'"
96938616 6908$ WC "sGMTIME_min='0'"
d83484c2 6909$ WC "sLOCALTIME_max='4294967295'"
96938616 6910$ WC "sLOCALTIME_min='0'"
570bb66e 6911$ WC "sPRId64='" + sPRId64 + "'"
d677d0fc
CB
6912$ WC "sPRIEUldbl='" + sPRIEUldbl + "'"
6913$ WC "sPRIFUldbl='" + sPRIFUldbl + "'"
6914$ WC "sPRIGUldbl='" + sPRIGUldbl + "'"
6915$ WC "sPRIXU64='" + sPRIXU64 + "'"
59a27e12 6916$ WC "sPRIeldbl='" + sPRIeldbl + "'"
570bb66e
JH
6917$ WC "sPRIfldbl='" + sPRIfldbl + "'"
6918$ WC "sPRIgldbl='" + sPRIgldbl + "'"
d677d0fc 6919$ WC "sPRIi64='" + sPRIi64 + "'"
570bb66e
JH
6920$ WC "sPRIo64='" + sPRIo64 + "'"
6921$ WC "sPRIu64='" + sPRIu64 + "'"
6922$ WC "sPRIx64='" + sPRIx64 + "'"
b5ddfb46 6923$ WC "sSCNfldbl='" + sSCNfldbl + "'"
570bb66e 6924$ WC "sched_yield='" + sched_yield + "'"
f688e3ac 6925$ WC "scriptdir='" + scriptdir + "'"
86761af6 6926$ WC "scriptdirexp='" + scriptdir + "'" ! use scriptdir for now
570bb66e
JH
6927$ WC "seedfunc='" + seedfunc + "'"
6928$ WC "selectminbits='32'"
6929$ WC "selecttype='" + selecttype + "'"
6930$ WC "sh='MCR'"
58046ef3 6931$ WC "sharpbang='#!'"
3f88addd 6932$ WC "shmattype='" + shmattype + "'"
570bb66e 6933$ WC "shortsize='" + shortsize + "'"
fe1de8ce
CB
6934$ IF (f$length(sig_name) .GE. 244)
6935$ THEN
6936$ tmp = "sig_name='" + sig_name + "'"
6937$ WC/symbol tmp
6938$ DELETE/SYMBOL tmp
6939$ ELSE
6940$ WC "sig_name='" + sig_name + "'"
6941$ ENDIF
6942$ IF (f$length(sig_name_init) .GE. 244)
ecd6e098
AT
6943$ THEN
6944$ tmp = "sig_name_init='" + sig_name_init + "'"
6945$ WC/symbol tmp
6946$ DELETE/SYMBOL tmp
6947$ ELSE
6948$ WC "sig_name_init='" + sig_name_init + "'"
6949$ ENDIF
570bb66e
JH
6950$ WC "sig_num='" + sig_num + "'"
6951$ WC "sig_num_init='" + sig_num_init + "'"
acabf64b 6952$ WC "sig_count='" + sig_count + "'"
76d3c696 6953$ WC "sig_size='" + sig_size + "'"
570bb66e
JH
6954$ WC "signal_t='" + signal_t + "'"
6955$ WC "sitearch='" + sitearch + "'"
6956$ WC "sitearchexp='" + sitearchexp + "'"
ec18bc92
CB
6957$ WC "sitebin='" + sitebin + "'"
6958$ WC "sitebinexp='" + sitebin + "'"
570bb66e
JH
6959$ WC "sitelib='" + sitelib + "'"
6960$ WC "sitelib_stem='" + sitelib_stem + "'"
6961$ WC "sitelibexp='" + sitelibexp + "'"
ec18bc92 6962$ WC "siteprefix='" + vms_prefix + "'"
097f20ec 6963$ WC "siteprefixexp='/" + vms_prefix + "'"
570bb66e
JH
6964$ WC "sizesize='" + sizesize + "'"
6965$ WC "sizetype='size_t'"
6966$ WC "so='" + so + "'"
6967$ WC "socksizetype='" + socksizetype + "'"
6968$ WC "spitshell='write sys$output '"
6969$ WC "src='" + src + "'"
6970$ WC "ssizetype='int'"
6971$ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
17e8697d 6972$ WC "static_ext='" + static_ext + "'"
17660758 6973$ WC "st_ino_size='" + st_ino_size + "'"
adf2bd28 6974$ WC "st_ino_sign='1'"
570bb66e
JH
6975$ WC "stdchar='" + stdchar + "'"
6976$ WC "stdio_base='((*fp)->_base)'"
6977$ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
6978$ WC "stdio_cnt='((*fp)->_cnt)'"
6979$ WC "stdio_ptr='((*fp)->_ptr)'"
59a27e12 6980$ WC "stdio_stream_array=' " + "'"
570bb66e 6981$ WC "subversion='" + subversion + "'"
d91e3179 6982$ WC "targetarch='" + "'"
d643f78d 6983$ WC "targetsh='MCR'"
570bb66e
JH
6984$ WC "timetype='" + timetype + "'"
6985$ WC "u16size='" + u16size + "'"
6986$ WC "u16type='" + u16type + "'"
6987$ WC "u32size='" + u32size + "'"
6988$ WC "u32type='" + u32type + "'"
6989$ WC "u64size='" + u64size + "'"
6990$ WC "u64type='" + u64type + "'"
6991$ WC "u8size='" + u8size + "'"
6992$ WC "u8type='" + u8type + "'"
6993$ WC "uidformat='lu'"
6994$ WC "uidsign='1'"
6995$ WC "uidsize='4'"
6996$ WC "uidtype='" + uidtype + "'"
6997$ WC "uquadtype='" + uquadtype + "'"
570bb66e
JH
6998$ WC "use64bitall='" + use64bitall + "'"
6999$ WC "use64bitint='" + use64bitint + "'"
9b5c8979
JH
7000$ WC "usecasesensitive='" + be_case_sensitive + "'" ! VMS-specific
7001$ WC "usedebugging_perl='"+use_debugging_perl+"'"
19aaf929 7002$ WC "usedefaultstrict='undef'"
9b5c8979 7003$ WC "usedefaulttypes='" + usedefaulttypes + "'" ! VMS-specific
f6a82ade 7004$ WC "usecbacktrace='undef'"
5440bc8e 7005$ WC "usecrosscompile='undef'"
580410d2 7006$ WC "usedevel='" + usedevel + "'"
570bb66e 7007$ WC "usedl='" + usedl + "'"
5ac1e9b2 7008$ WC "usedtrace='undef'"
ea77424f 7009$ WC "usefaststdio='" + usefaststdio + "'"
9b5c8979 7010$ WC "useieee='" + useieee + "'" ! VMS-specific
570bb66e 7011$ WC "useithreads='" + useithreads + "'"
3f39e13a 7012$ WC "usekernelthreads='" + usekernelthreads + "'" ! VMS-specific
2982a345 7013$ WC "usekernprocpathname='undef'"
ae60cb46 7014$ WC "usensgetexecutablepath='undef'"
570bb66e
JH
7015$ WC "uselargefiles='" + uselargefiles + "'"
7016$ WC "uselongdouble='" + uselongdouble + "'"
7017$ WC "usemorebits='" + usemorebits + "'"
7018$ WC "usemultiplicity='" + usemultiplicity + "'"
7019$ WC "usemymalloc='" + usemymalloc + "'"
712b953a 7020$ WC "useperlio='define'"
570bb66e 7021$ WC "useposix='false'"
5cbc5191 7022$ WC "usequadmath='undef'"
9514c62b 7023$ WC "usereentrant='undef'"
4fd0a66c 7024$ WC "userelocatableinc='undef'"
9b5c8979 7025$ WC "usesecurelog='" + usesecurelog + "'" ! VMS-specific
1171624b 7026$ WC "useshortenedsymbols='" + useshortenedsymbols + "'" ! VMS-specific
b672680a 7027$ WC "useshrplib='true'"
79e63f36 7028$ WC "usesitecustomize='" + usesitecustomize + "'"
570bb66e
JH
7029$ WC "usesocks='undef'"
7030$ WC "usethreads='" + usethreads + "'"
3f39e13a 7031$ WC "usethreadupcalls='" + usethreadupcalls + "'" ! VMS-specific
ec18bc92 7032$ WC "usevendorprefix='" + "'" ! try to say no, though we'll be ignored as of MM 5.90_01
139a355e 7033$ WC "useversionedarchname='" + useversionedarchname + "'"
570bb66e 7034$ WC "usevfork='true'"
9b5c8979 7035$ WC "usevmsdebug='" + usevmsdebug + "'" ! VMS-specific
570bb66e
JH
7036$ WC "uvoformat='" + uvoformat + "'"
7037$ WC "uvsize='" + uvsize + "'"
7038$ WC "uvtype='" + uvtype + "'"
7039$ WC "uvuformat='" + uvuformat + "'"
7040$ WC "uvxformat='" + uvxformat + "'"
414b89cc 7041$ WC "uvXUformat='" + uvXUformat + "'"
ec18bc92 7042$ WC "vendorarch='" + "'"
570bb66e 7043$ WC "vendorarchexp='" + "'"
ec18bc92
CB
7044$ WC "vendorbin='" + "'"
7045$ WC "vendorbinexp='" + "'"
570bb66e 7046$ WC "vendorlib_stem='" + "'"
ec18bc92 7047$ WC "vendorlib='" + "'"
570bb66e 7048$ WC "vendorlibexp='" + "'"
ec18bc92
CB
7049$ WC "vendorprefix='" + "'"
7050$ WC "vendorprefixexp='" + "'"
570bb66e 7051$ WC "version='" + version + "'"
9ec25520 7052$ WC "version_patchlevel_string='" + version_patchlevel_string + "'"
570bb66e
JH
7053$ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
7054$ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
7055$ WC "vms_ver='" + vms_ver + "'" ! VMS specific
10bc17b6
JH
7056$!
7057$! ## The UNIXy POSIXy reentrantey thingys ##
8df869cb
CB
7058$! See "Appendix B, Version-Dependency Tables" in the C RTL
7059$! manual for when assorted _r functions became available.
10bc17b6 7060$!
054a3baf 7061$ IF use_threads
8df869cb 7062$ THEN
4f93eb5d 7063$ WC "asctime_r_proto='REENTRANT_PROTO_B_SB'"
8df869cb 7064$ WC "d_asctime_r='define'"
4f93eb5d 7065$ WC "ctime_r_proto='REENTRANT_PROTO_B_SB'"
8df869cb 7066$ WC "d_ctime_r='define'"
8df869cb
CB
7067$ ELSE
7068$ WC "asctime_r_proto='0'"
7069$ WC "d_asctime_r='undef'"
4f93eb5d 7070$ WC "ctime_r_proto='0'"
8df869cb 7071$ WC "d_ctime_r='undef'"
8df869cb 7072$ ENDIF
10bc17b6
JH
7073$ WC "d_crypt_r='undef'"
7074$ WC "d_ctermid_r='undef'"
10bc17b6
JH
7075$ WC "d_drand48_r='undef'"
7076$ WC "d_endgrent_r='undef'"
7077$ WC "d_endhostent_r='undef'"
7078$ WC "d_endnetent_r='undef'"
7079$ WC "d_endprotoent_r='undef'"
7080$ WC "d_endpwent_r='undef'"
7081$ WC "d_endservent_r='undef'"
0f2b45c7 7082$ WC "d_freelocale='undef'"
5149e178 7083$ WC "d_gai_strerror='define'"
10bc17b6 7084$ WC "d_getgrent_r='undef'"
96021e87
JM
7085$ WC "d_getgrgid_r='" + d_getgrgid_r + "'"
7086$ WC "d_getgrnam_r='" + d_getgrnam_r + "'"
10bc17b6
JH
7087$ WC "d_gethostbyaddr_r='undef'"
7088$ WC "d_gethostbyname_r='undef'"
7089$ WC "d_gethostent_r='undef'"
931a625b 7090$ WC "d_getlogin_r='define'"
10bc17b6
JH
7091$ WC "d_getnetbyaddr_r='undef'"
7092$ WC "d_getnetbyname_r='undef'"
7093$ WC "d_getnetent_r='undef'"
7094$ WC "d_getprotobyname_r='undef'"
7095$ WC "d_getprotobynumber_r='undef'"
7096$ WC "d_getprotoent_r='undef'"
7097$ WC "d_getpwent_r='undef'"
96021e87
JM
7098$ WC "d_getpwnam_r='" + d_getpwnam_r + "'"
7099$ WC "d_getpwuid_r='" + d_getpwuid_r + "'"
10bc17b6
JH
7100$ WC "d_getservbyname_r='undef'"
7101$ WC "d_getservbyport_r='undef'"
7102$ WC "d_getservent_r='undef'"
7103$ WC "d_getspnam_r='undef'"
4f93eb5d 7104$ WC "d_gmtime_r='undef'" ! leave undef'd; we use my_gmtime
a7ed70b3 7105$ WC "d_lgamma_r='undef'"
4f93eb5d 7106$ WC "d_localtime_r='undef'" ! leave undef'd; we use my_localtime
f025e94b 7107$ WC "d_localtime_r_needs_tzset='undef'"
0f2b45c7 7108$ WC "d_newlocale='undef'"
bc900e45 7109$ WC "d_querylocale='undef'"
10bc17b6 7110$ WC "d_random_r='undef'"
a9852f7c 7111$ WC "d_readdir_r='define'" ! always defined; we roll our own
10bc17b6 7112$ WC "d_readdir64_r='undef'"
10bc17b6
JH
7113$ WC "d_setgrent_r='undef'"
7114$ WC "d_sethostent_r='undef'"
7115$ WC "d_setlocale_r='undef'"
7116$ WC "d_setnetent_r='undef'"
7117$ WC "d_setprotoent_r='undef'"
7118$ WC "d_setpwent_r='undef'"
7119$ WC "d_setservent_r='undef'"
4059ba87 7120$ WC "d_snprintf='" + d_snprintf + "'"
10bc17b6
JH
7121$ WC "d_srand48_r='undef'"
7122$ WC "d_srandom_r='undef'"
ef55c673 7123$ WC "d_strerror_l='undef'"
10bc17b6
JH
7124$ WC "d_strerror_r='undef'"
7125$ WC "d_tmpnam_r='undef'"
0806cdda
KW
7126$ WC "d_towlower='define'"
7127$ WC "d_towupper='define'"
96021e87 7128$ WC "d_ttyname_r='" + d_ttyname_r + "'"
0f2b45c7 7129$ WC "d_uselocale='undef'"
4f93eb5d
CB
7130$ WC "ctermid_r_proto='0'"
7131$ WC "crypt_r_proto='0'"
10bc17b6
JH
7132$ WC "drand48_r_proto='0'"
7133$ WC "endgrent_r_proto='0'"
7134$ WC "endhostent_r_proto='0'"
7135$ WC "endnetent_r_proto='0'"
7136$ WC "endprotoent_r_proto='0'"
7137$ WC "endpwent_r_proto='0'"
7138$ WC "endservent_r_proto='0'"
7139$ WC "getgrent_r_proto='0'"
96021e87
JM
7140$ WC "getgrgid_r_proto='" + getgrgid_r_proto + "'"
7141$ WC "getgrnam_r_proto='" + getgrnam_r_proto + "'"
10bc17b6
JH
7142$ WC "gethostbyaddr_r_proto='0'"
7143$ WC "gethostbyname_r_proto='0'"
7144$ WC "gethostent_r_proto='0'"
931a625b
CB
7145$ IF use_threads
7146$ THEN
7147$ WC "getlogin_r_proto='REENTRANT_PROTO_I_BW'"
7148$ ELSE
7149$ WC "getlogin_r_proto='0'"
7150$ ENDIF
10bc17b6
JH
7151$ WC "getnetbyaddr_r_proto='0'"
7152$ WC "getnetbyname_r_proto='0'"
7153$ WC "getnetent_r_proto='0'"
7154$ WC "getprotobyname_r_proto='0'"
7155$ WC "getprotobynumber_r_proto='0'"
7156$ WC "getprotoent_r_proto='0'"
7157$ WC "getpwent_r_proto='0'"
7158$ WC "getpwnam_r_proto='0'"
7159$ WC "getpwuid_r_proto='0'"
7160$ WC "getservbyname_r_proto='0'"
7161$ WC "getservbyport_r_proto='0'"
7162$ WC "getservent_r_proto='0'"
7163$ WC "getspnam_r_proto='0'"
7164$ WC "gmtime_r_proto='0'"
10bc17b6
JH
7165$ WC "localtime_r_proto='0'"
7166$ WC "random_r_proto='0'"
a9852f7c 7167$ WC "readdir_r_proto='REENTRANT_PROTO_I_TSR'" ! always defined; we roll our own
4f93eb5d 7168$ WC "readdir64_r_proto='0'"
10bc17b6
JH
7169$ WC "setgrent_r_proto='0'"
7170$ WC "sethostent_r_proto='0'"
7171$ WC "setlocale_r_proto='0'"
7172$ WC "setnetent_r_proto='0'"
7173$ WC "setprotoent_r_proto='0'"
7174$ WC "setpwent_r_proto='0'"
7175$ WC "setservent_r_proto='0'"
7176$ WC "srand48_r_proto='0'"
7177$ WC "srandom_r_proto='0'"
7178$ WC "strerror_r_proto='0'"
7179$ WC "tmpnam_r_proto='0'"
96021e87 7180$ WC "ttyname_r_proto='" + ttyname_r_proto + "'"
570bb66e
JH
7181$!
7182$! ##END WRITE NEW CONSTANTS HERE##
7183$!
7184$ CLOSE CONFIG
7185$!
7186$! Okay, we've gotten here. Build munchconfig.exe
7187$ COPY/NOLOG [-.vms]munchconfig.c []
7558ebc2 7188$ COPY/NOLOG [-.vms]'Makefile_SH' []
1632ad18 7189$ 'Perl_CC' 'ccflags' munchconfig.c
570bb66e
JH
7190$ IF Needs_Opt
7191$ THEN
7192$ OPEN/WRITE CONFIG []munchconfig.opt
414b89cc 7193$ IF ccname .EQS. "GCC"
570bb66e
JH
7194$ THEN
7195$ WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
7196$ ENDIF
7197$ WRITE CONFIG "Sys$Share:VAXCRTL/Share"
7198$ CLOSE CONFIG
dd3163fe 7199$ 'ld'/EXE='exe_ext' munchconfig'obj_ext',munchconfig.opt/opt
570bb66e
JH
7200$ DELETE/NOLOG/NOCONFIRM munchconfig.opt;
7201$ ELSE
dd3163fe 7202$ 'ld'/EXE='exe_ext' munchconfig'obj_ext'
570bb66e 7203$ ENDIF
dd3163fe 7204$ IF F$SEARCH("munchconfig''obj_ext'") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig'obj_ext';
570bb66e 7205$ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
414b89cc 7206$ IF ccname .EQS. "CXX"
570bb66e
JH
7207$ THEN
7208$ CALL Cxx_demangler_cleanup
7209$ ENDIF
7210$!
7211$ IF alldone .EQS. ""
7212$ THEN
7213$ cat4 SYS$INPUT:
7558ebc2 7214$ DECK
570bb66e
JH
7215
7216If you'd like to make any changes to the config.sh file before I begin
7217to configure things, answer yes to the following question.
7218
7558ebc2 7219$ EOD
9b5c8979
JH
7220$ bool_dflt="n"
7221$ rp="Do you wish to edit ''basename_config_sh'? [''bool_dflt'] "
570bb66e 7222$ GOSUB myread
570bb66e
JH
7223$ IF ans
7224$ THEN
7225$ echo4 ""
7226$ echo4 "Be sure to type LOGOUT after you have edited the file,"
7227$ echo4 "then this procedure will resume."
7228$ echo4 ""
7229$ default = F$ENVIRONMENT("DEFAULT")
7558ebc2 7230$ DIRECTORY 'config_sh'
570bb66e
JH
7231$ SET DEFAULT [-]
7232$ SPAWN/WAIT
7558ebc2 7233$ SET DEFAULT 'default'
570bb66e
JH
7234$ ENDIF
7235$ ENDIF
7236$!
7237$ echo ""
7238$ echo4 "Adding ''osname' specific preprocessor commands."
7239$ !
7240$ ! we need an fdl file
7241$ CREATE [-]CONFIG.FDL
7558ebc2 7242$ DECK
570bb66e
JH
7243RECORD
7244 FORMAT STREAM_LF
7558ebc2 7245$ EOD
570bb66e
JH
7246$ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
7247$ ! First spit out the header info with the local defines (to get
7248$ ! around the 255 character command line limit)
7249$ OPEN/APPEND CONFIG [-]config.local
7250$ IF use_debugging_perl THEN WC "#define DEBUGGING"
7251$ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
7252$ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
7253$ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
7254$ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
414b89cc 7255$ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
570bb66e
JH
7256$ IF (Has_Dec_C_Sockets)
7257$ THEN
7258$ WC "#define VMS_DO_SOCKETS"
7259$ WC "#define DECCRTL_SOCKETS"
570bb66e
JH
7260$ ENDIF
7261$! This is VMS-specific for now
7262$ WC "#''d_setenv' HAS_SETENV"
7263$ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
7264$ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
7265$ IF use64bitint .OR. use64bitint .EQS. "define"
7266$ THEN
7267$ WC "#define USE_64_BIT_INT"
e5be143b
CB
7268$ ENDIF
7269$ IF uselongdouble .OR. uselongdouble .EQS. "define"
7270$ THEN
570bb66e
JH
7271$ WC "#define USE_LONG_DOUBLE"
7272$ ENDIF
7273$ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
7274 WC "#define USE_64_BIT_ALL"
7275$ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
1171624b 7276$ IF shorten_long_symbols THEN WC "#define VMS_SHORTEN_LONG_SYMBOLS"
3ffb755e 7277$ IF use_ieee_math THEN WC "#define USE_IEEE"
570bb66e
JH
7278$ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
7279$ WC "#define HAS_ENVGETENV"
7280$ WC "#define PERL_EXTERNAL_GLOB"
f2610a60 7281$ IF kill_by_sigprc .EQS. "define" then WC "#define KILL_BY_SIGPRC"
4adb8845
CB
7282$ IF unlink_all_versions .OR. unlink_all_versions .EQS. "define" THEN -
7283 WC "#define UNLINK_ALL_VERSIONS"
234242ca 7284$ IF d_sockaddr_sa_len .EQS. "define" then WC "#define _SOCKADDR_LEN 1"
85fac3a9
CB
7285$ IF ccname .EQS. "CXX" then WC "#define NO_ENVIRON_ARRAY"
7286$ IF ccname .EQS. "CXX" then WC "#define VMS" ! only has __VMS by default
7430efdb 7287$ WC "#define _PTHREAD_EXC_INCL_CLEAN" ! avoid conflict between DECthreads TRY/CATCH and Perl TRY/CATCH
570bb66e
JH
7288$ CLOSE CONFIG
7289$!
7290$ echo4 "Doing variable substitutions on .SH files..."
7291$ echo4 "Extracting config.h (with variable substitutions)"
7292$!
7293$! Now build the normal config.h
7294$ DEFINE/USER_MODE sys$output [-]config.main
dd3163fe 7295$ mcr []munchconfig'exe_ext' 'config_sh' [-]config_h.sh
570bb66e
JH
7296$ ! Concatenate them together
7297$ copy [-]config.local,[-]config.main [-]config.h
7298$! Clean up
fcc434ad
PP
7299$ DELETE/NOLOG/NOCONFIRM [-]CONFIG.MAIN;*
7300$ DELETE/NOLOG/NOCONFIRM [-]CONFIG.LOCAL;*
7301$ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;*
570bb66e 7302$!
414b89cc 7303$ IF ccname .EQS. "DEC"
570bb66e
JH
7304$ THEN
7305$ DECC_REPLACE = "DECC=decc=1"
7306$ ELSE
7558ebc2
PP
7307$ DECC_REPLACE = "DECC="
7308$ ENDIF
414b89cc 7309$ IF ccname .EQS. "CXX"
7558ebc2
PP
7310$ THEN
7311$ DECCXX_REPLACE = "DECCXX=DECCXX=1"
7312$ ELSE
7313$ DECCXX_REPLACE = "DECCXX="
570bb66e 7314$ ENDIF
414b89cc 7315$ IF ccname .EQS. "GCC"
570bb66e
JH
7316$ THEN
7317$ GNUC_REPLACE = "GNUC=gnuc=1"
7318$ ELSE
7319$ GNUC_REPLACE = "GNUC="
7320$ ENDIF
7321$ IF Has_Dec_C_Sockets
7322$ THEN
7323$ SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
7324$ ELSE
046cc26c 7325$ SOCKET_REPLACE = "SOCKET="
570bb66e 7326$ ENDIF
a92ae878 7327$ IF use_threads
570bb66e 7328$ THEN
32995a38 7329$ THREAD_REPLACE = "THREAD=THREADED=1"
570bb66e
JH
7330$ ELSE
7331$ THREAD_REPLACE = "THREAD="
7332$ ENDIF
7333$ IF mymalloc
7334$ THEN
7335$ MALLOC_REPLACE = "MALLOC=MALLOC=1"
7336$ ELSE
7337$ MALLOC_REPLACE = "MALLOC="
7338$ ENDIF
e0261ef8
CB
7339$ IF uselargefiles .OR. uselargefiles .EQS. "define"
7340$ THEN
cfcfe586
JM
7341$ IF usestdstat .or. usestdstat .eqs. "define"
7342$ THEN
7343$ LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_USE_STD_STAT=1"
7344$ ELSE
96021e87 7345$ LARGEFILE_REPLACE = "LARGEFILE=LARGEFILE=_LARGEFILE=1"
cfcfe586 7346$ ENDIF
e0261ef8
CB
7347$ ELSE
7348$ LARGEFILE_REPLACE = "LARGEFILE="
7349$ ENDIF
9152021d
CB
7350$ IF use_vmsdebug_perl
7351$ THEN
7352$ DEBUG_REPLACE = "USEVMSDEBUG=__DEBUG__=1"
7353$ ELSE
7354$ DEBUG_REPLACE = "USEVMSDEBUG="
7355$ ENDIF
b545184e 7356$ PREFIX_REPLACE = "PREFIX=PREFIX=''prefix'"
b8df70f4
CB
7357$!
7358$! In order not to stress the tiny command buffer on pre-7.3-2 systems,
7359$! we put the following substitutions in a file and pass the file to
7360$! munchconfig.
7361$!
7362$ open/write CONFIG extra_subs.txt
7363$ WC := write CONFIG
7364$ WC "''DECC_REPLACE'"
7365$ WC "''DECCXX_REPLACE'"
7366$ WC "''ARCH_TYPE'"
7367$ WC "''GNUC_REPLACE'"
7368$ WC "''SOCKET_REPLACE'"
7369$ WC "''THREAD_REPLACE'"
7370$ WC "''C_Compiler_Replace'"
7371$ WC "''MALLOC_REPLACE'"
7372$ WC "''THREAD_UPCALLS'"
7373$ WC "''THREAD_KERNEL'"
7374$ WC "PV=''version'"
7375$ WC "FLAGS=FLAGS=''extra_flags'"
7376$ WC "''LARGEFILE_REPLACE'"
44caa20c 7377$ WC "ARCHNAME=ARCHNAME=''archname'"
9152021d 7378$ WC "''DEBUG_REPLACE'"
b545184e 7379$ WC "''PREFIX_REPLACE'"
b8df70f4
CB
7380$ close CONFIG
7381$!
570bb66e 7382$ echo4 "Extracting ''defmakefile' (with variable substitutions)"
7558ebc2 7383$ DEFINE/USER_MODE sys$output 'UUmakefile'
dd3163fe 7384$ mcr []munchconfig'exe_ext' 'config_sh' 'Makefile_SH' -f extra_subs.txt
7558ebc2 7385$! Clean up after ourselves
dd3163fe 7386$ DELETE/NOLOG/NOCONFIRM []munchconfig'exe_ext';
b8df70f4 7387$ DELETE/NOLOG/NOCONFIRM []extra_subs.txt;
a3bd614a 7388$!
414b89cc
CB
7389$! Note that the /key qualifier to search, as in:
7390$! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
7391$! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
7392$!
7393$ echo4 "Extracting extra_pods.com (without variable substitutions)"
7394$ Create Sys$Disk:[-]extra_pods.com
7395$ Deck/Dollar="$EOExtra_Pods$"
7396$!++ extra_pods.com
7397$! NOTE: This file is extracted as part of the VMS configuration process.
7398$! Any changes made to it directly will be lost. If you need to make any
7399$! changes, please edit the template in Configure.Com instead.
7400$! Use FORCE if you've just podified a README.* file on VMS.
dd3163fe 7401$ miniperl = f$search("sys$disk:[]miniperl.%xe;") ! could have alternate extension
414b89cc
CB
7402$ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
7403 search README.* "=head"/window=0/output=extra.pods
7404$ open/read/error=extra_close EXTRA extra.pods
7405$extra_loop:
7406$ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
1f74f634 7407$ file_type = f$edit(f$parse(file,,,"TYPE",),"LOWERCASE") - "."
414b89cc
CB
7408$ if file_type .nes. "VMS" .and. file_type .nes. "vms"
7409$ then
7410$ pod_file = "[.pod]perl''file_type'.pod"
7411$ file = file - "''f$parse(file,,,"VERSION",)'"
7412$ if p1 .eqs. "CLEAN"
7413$ then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
7414$ else
7415$ do_copy := false
7416$ if f$search(pod_file) .eqs. ""
7417$ then do_copy := true
7418$ else
7419$ file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
7420$ pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
7421$ if file_rdt .GTS. pod_file_rdt then do_copy := true
7422$ endif
1f74f634 7423$ ! wacky method to preserve case on ODS-5 even when parse style is traditional
dd3163fe 7424$ if do_copy then mcr 'miniperl' -e "exit 0+$^E unless File::Copy::rmscopy(q{''file'}, q{''pod_file'});"
414b89cc
CB
7425$ endif
7426$ endif
7427$ goto extra_loop
7428$extra_close:
7429$ close EXTRA
7430$ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
7431 purge/nolog extra.pods
7432$!-- extra_pods.com
7433$EOExtra_Pods$
97abc6ad 7434$!
146174a9 7435$! Warn of dangerous symbols or logical names
a4521476 7436$!
146174a9
CB
7437$Bad_environment: SUBROUTINE
7438$ Bad_env = ""
7439$ IF p2 .eqs. "SYMBOL"
7440$ THEN
7558ebc2 7441$ IF f$type('p1') .nes. "" THEN Bad_env := SYMBOL
146174a9
CB
7442$ ELSE
7443$ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
7444$ ENDIF
7445$ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
a4521476
PP
7446$ THEN
7447$ IF f$search("config.msg") .nes. ""
7448$ THEN
7449$ OPEN/APPEND CONFIG config.msg
7450$ ELSE
7451$ OPEN/WRITE CONFIG config.msg
7452$ ENDIF
146174a9
CB
7453$ IF Bad_env .eqs. "SYMBOL"
7454$ THEN
7455$ WRITE CONFIG ""
7456$ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
7457$ WRITE CONFIG " delete before building ''package' via:"
7458$ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
7459$ IF f$locate("""",&p1) .ge. f$length(&p1)
7460$ THEN
7558ebc2 7461$ WRITE CONFIG " after building, testing, and installing ''package'"
146174a9
CB
7462$ WRITE CONFIG " restore the symbol with:"
7463$ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
7464$ ENDIF
7465$ ENDIF
7466$ IF Bad_env .eqs. "LOGICAL"
7467$ THEN
7468$ WRITE CONFIG ""
7469$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
7470$ WRITE CONFIG " deassign before building ''package'"
7471$ ENDIF
a4521476 7472$ CLOSE CONFIG
146174a9 7473$ Bad_env = ""
a4521476
PP
7474$ ENDIF
7475$ EXIT
146174a9 7476$ ENDSUBROUTINE ! Bad_environment
a4521476 7477$ echo ""
570bb66e 7478$ echo4 "Checking for dangerous pre-existing global symbols and logical names."
b3b333bf 7479$ CALL Bad_environment "COMP"
139df077
CB
7480$ CALL Bad_environment "EXT"
7481$ CALL Bad_environment "FOO"
146174a9 7482$ CALL Bad_environment "LIB"
139df077
CB
7483$ CALL Bad_environment "LIST"
7484$ CALL Bad_environment "MIME"
7485$ CALL Bad_environment "POSIX"
7486$ CALL Bad_environment "SYS"
146174a9 7487$ CALL Bad_environment "T"
139df077
CB
7488$ CALL Bad_environment "THREAD"
7489$ CALL Bad_environment "THREADS"
7490$ CALL Bad_environment "TIME"
7491$ CALL Bad_environment "TMP"
7492$ CALL Bad_environment "UNICODE"
7493$ CALL Bad_environment "UTIL"
146174a9 7494$ CALL Bad_environment "TEST" "SYMBOL"
a4521476
PP
7495$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
7496$!
97abc6ad
HM
7497$! %Config-I-VMS, write perl_setup.com here
7498$!
86fced14
CB
7499$ IF (.NOT.perl_symbol)
7500$ THEN
7501$ file_2_find = "[-]''packageup'.cld"
7502$ echo ""
570bb66e 7503$ echo4 "The perl.cld file is now being written..."
86fced14 7504$ OPEN/WRITE CONFIG 'file_2_find'
c645ec3f 7505$ ext = ".exe"
2b4b3ebb
CB
7506$ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP") THEN ext := .AXE
7507$ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_IA64") THEN ext := .IXE
86fced14
CB
7508$ IF (use_vmsdebug_perl)
7509$ THEN
7510$ WRITE CONFIG "define verb dbgperl"
570bb66e 7511$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
86fced14
CB
7512$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7513$ WRITE CONFIG ""
7514$ WRITE CONFIG "define verb perl"
570bb66e 7515$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
86fced14
CB
7516$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7517$ ELSE
7518$ WRITE CONFIG "define verb perl"
570bb66e 7519$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
86fced14
CB
7520$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
7521$ ENDIF
7522$ CLOSE CONFIG
7523$ ENDIF ! (.NOT.perl_symbol)
97abc6ad 7524$ echo ""
570bb66e 7525$ echo4 "The perl_setup.com file is now being written..."
a3ef2c6f 7526$ file_2_find = "[-]perl_setup.com"
fcc434ad
PP
7527$!
7528$! Folks are likely to want to edit perl_setup.com.
7529$! STMLF RFM plays nicer with ported editors than does VFC.
7530$!
7531$ CREATE [-]CONFIG.FDL
7532$ DECK
7533RECORD
7534 FORMAT STREAM_LF
7535$ EOD
7536$ CREATE /FDL=[-]CONFIG.FDL 'file_2_find'
7537$ OPEN/APPEND CONFIG 'file_2_find'
7538$ DELETE/NOLOG/NOCONFIRM [-]CONFIG.FDL;
97abc6ad
HM
7539$ WRITE CONFIG "$!"
7540$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
7541$ IF cf_email.NES.perladmin
7542$ THEN
7543$ WRITE CONFIG "$! perl configured by ''cf_email'"
7544$ ELSE
7545$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
7546$ ENDIF
7547$ WRITE CONFIG "$!"
b545184e
CB
7548$ WRITE CONFIG "$ if P1 .EQS. """""
7549$ WRITE CONFIG "$ then"
7550$ WRITE CONFIG "$ myproc = f$environment(""PROCEDURE"")"
7551$ WRITE CONFIG "$ myroot_dev = f$parse(myproc,,,""DEVICE"",""NO_CONCEAL"")"
7552$ WRITE CONFIG "$ myroot_dir = f$parse(myproc,,,""DIRECTORY"",""NO_CONCEAL"")"
7553$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000."" - ""><000000."""
7554$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""][000000]"" - ""><000000>"""
7555$ WRITE CONFIG "$ myroot_dir = myroot_dir - ""]["" - ""><"""
7556$ WRITE CONFIG "$ myroot_dir = myroot_dir - "".]"" - "".>"" - ""["" - ""]"" - ""<"" - "">"""
7557$ WRITE CONFIG "$ root_spec = myroot_dev + ""["" + myroot_dir + "".]"""
7558$ WRITE CONFIG "$ else"
7559$ WRITE CONFIG "$ root_spec = P1"
7560$ WRITE CONFIG "$ endif"
7561$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' 'root_spec'"
86fced14 7562$ WRITE CONFIG "$ ext = "".exe"""
570bb66e 7563$ IF sharedperl
86fced14 7564$ THEN
86da1428
CB
7565$ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 2 then ext = "".AXE"""
7566$ WRITE CONFIG "$ if f$getsyi(""ARCH_TYPE"") .eq. 3 then ext = "".IXE"""
86fced14
CB
7567$ ENDIF
7568$ IF (perl_symbol)
7569$ THEN
972e9305 7570$ perl_setup_perl = "'" + "'perl'" ! triple quoted foreign command symbol
86fced14
CB
7571$ IF (use_vmsdebug_perl)
7572$ THEN
972e9305
PP
7573$ WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgperl'ext'"
7574$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]ndbgperl'ext'"
7575$ WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
86fced14 7576$ ELSE
570bb66e 7577$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
972e9305 7578$ WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
86fced14
CB
7579$ ENDIF
7580$ ELSE ! .NOT.perl_symbol
972e9305 7581$ perl_setup_perl = "perl" ! command verb
86fced14
CB
7582$ IF (use_vmsdebug_perl)
7583$ THEN
972e9305 7584$ WRITE CONFIG "$ define dbgperlshr ''vms_prefix':[000000]dbgperlshr'ext'"
86fced14 7585$ ELSE
972e9305 7586$ WRITE CONFIG "$ define perlshr ''vms_prefix':[000000]perlshr'ext'"
86fced14
CB
7587$ ENDIF
7588$ IF perl_verb .EQS. "PROCESS"
7589$ THEN
570bb66e 7590$ WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
86fced14
CB
7591$ ENDIF
7592$ ENDIF ! perl_symbol
3eeba6fb 7593$!
97abc6ad
HM
7594$ IF (tzneedset)
7595$ THEN
7596$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7597$ ELSE !leave in but commented out (in case setting was from perl :-)
7598$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
7599$ ENDIF
7600$ WRITE CONFIG "$!"
9ee2021e 7601$ WRITE CONFIG "$! Symbols for Perl-based utility programs:"
97abc6ad 7602$ WRITE CONFIG "$!"
9ee2021e 7603$ WRITE CONFIG "$ corelist == """ + perl_setup_perl + " ''vms_prefix':[utils]corelist.com"""
972e9305 7604$ WRITE CONFIG "$ cpan == """ + perl_setup_perl + " ''vms_prefix':[utils]cpan.com"""
972e9305 7605$ WRITE CONFIG "$ enc2xs == """ + perl_setup_perl + " ''vms_prefix':[utils]enc2xs.com"""
59658819 7606$ WRITE CONFIG "$ encguess == """ + perl_setup_perl + " ''vms_prefix':[utils]encguess.com"""
972e9305
PP
7607$ WRITE CONFIG "$ h2ph == """ + perl_setup_perl + " ''vms_prefix':[utils]h2ph.com"""
7608$ WRITE CONFIG "$ h2xs == """ + perl_setup_perl + " ''vms_prefix':[utils]h2xs.com"""
88be34b6 7609$ WRITE CONFIG "$ instmodsh == """ + perl_setup_perl + " ''vms_prefix':[utils]instmodsh.com"""
073bdd79 7610$ WRITE CONFIG "$ json_pp == """ + perl_setup_perl + " ''vms_prefix':[utils]json_pp.com"""
972e9305 7611$ WRITE CONFIG "$ libnetcfg == """ + perl_setup_perl + " ''vms_prefix':[utils]libnetcfg.com"""
e8e09534 7612$ WRITE CONFIG "$ perlbug == """ + perl_setup_perl + " ''vms_prefix':[utils]perlbug.com"""
e8e09534 7613$ WRITE CONFIG "$ perldoc == """ + perl_setup_perl + " ''vms_prefix':[utils]perldoc.com """"-t"""""""
972e9305 7614$ WRITE CONFIG "$ perlivp == """ + perl_setup_perl + " ''vms_prefix':[utils]perlivp.com"""
073bdd79 7615$ WRITE CONFIG "$ perlthanks == """ + perl_setup_perl + " ''vms_prefix':[utils]perlthanks.com"""
972e9305
PP
7616$ WRITE CONFIG "$ piconv == """ + perl_setup_perl + " ''vms_prefix':[utils]piconv.com"""
7617$ WRITE CONFIG "$ pl2pm == """ + perl_setup_perl + " ''vms_prefix':[utils]pl2pm.com"""
e8e09534 7618$ WRITE CONFIG "$ pod2html == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2html.com"""
e8e09534
PP
7619$ WRITE CONFIG "$ pod2text == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2text.com"""
7620$ WRITE CONFIG "$!pod2man == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2man.com"""
972e9305
PP
7621$ WRITE CONFIG "$ pod2usage == """ + perl_setup_perl + " ''vms_prefix':[utils]pod2usage.com"""
7622$ WRITE CONFIG "$ podchecker == """ + perl_setup_perl + " ''vms_prefix':[utils]podchecker.com"""
7623$ WRITE CONFIG "$ podselect == """ + perl_setup_perl + " ''vms_prefix':[utils]podselect.com"""
20997843 7624$ WRITE CONFIG "$ prove == """ + perl_setup_perl + " ''vms_prefix':[utils]prove.com"""
9ee2021e
CB
7625$ WRITE CONFIG "$ ptar == """ + perl_setup_perl + " ''vms_prefix':[utils]ptar.com"""
7626$ WRITE CONFIG "$ ptardiff == """ + perl_setup_perl + " ''vms_prefix':[utils]ptardiff.com"""
deabda19 7627$ WRITE CONFIG "$ ptargrep == """ + perl_setup_perl + " ''vms_prefix':[utils]ptargrep.com"""
9ee2021e 7628$ WRITE CONFIG "$ shasum == """ + perl_setup_perl + " ''vms_prefix':[utils]shasum.com"""
972e9305
PP
7629$ WRITE CONFIG "$ splain == """ + perl_setup_perl + " ''vms_prefix':[utils]splain.com"""
7630$ WRITE CONFIG "$ xsubpp == """ + perl_setup_perl + " ''vms_prefix':[utils]xsubpp.com"""
08ad9465 7631$ WRITE CONFIG "$ zipdetails == """ + perl_setup_perl + " ''vms_prefix':[utils]zipdetails.com"""
97abc6ad
HM
7632$ CLOSE CONFIG
7633$!
7634$ echo ""
570bb66e
JH
7635$ echo "The file can be found at:"
7636$ echo4 " ''F$SEARCH(file_2_find)'"
7637$ echo "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
7638$ echo "when you are satisfied with a successful compilation,"
7639$ echo "testing, and installation of your perl."
97abc6ad 7640$ echo ""
86fced14
CB
7641$ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
7642$ THEN
7643$ file_2_find = "[-]''packageup'_install.com"
7558ebc2 7644$ OPEN/WRITE CONFIG 'file_2_find'
86fced14
CB
7645$ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
7646$ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
7647$ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
7648$ CLOSE CONFIG
7649$ echo4 ""
570bb66e
JH
7650$ echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
7651$ echo4 " @ ''F$SEARCH(file_2_find)'"
7652$ echo4 "after a successful build, test, and install. Do so with CMKRNL privilege."
86fced14
CB
7653$ echo4 ""
7654$ ENDIF
97abc6ad
HM
7655$!
7656$!figure out where we "are" by parsing 'vms_default_directory_name'
7657$!
7658$ set_def_command = ""
7659$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
7660$ tmp = vms_default_directory_name - dflt - "]"
7661$ i = 0
7662$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
7663$Set_def_loop:
7664$ tmp1 = F$ELEMENT(i,".",tmp)
7665$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
7666$ IF i .EQ. 0
7667$ THEN set_def_command = "set default [-"
7668$ ELSE set_def_command = set_def_command + "-"
7669$ ENDIF
7670$ i = i + 1
7671$ GOTO Set_def_loop
7672$Beyond_set_def_loop:
7673$ IF set_def_command.NES.""
7674$ THEN
7675$ set_def_command = set_def_command - "-" + "]"
7676$ echo4 ""
7677$ echo4 "In order to build ''package' you must now issue the commands:"
7678$ echo4 ""
7679$ echo4 " ''set_def_command'"
7680$ ELSE
7681$ echo4 ""
7682$ echo4 "In order to build ''package' you must now issue the command:"
7683$ echo4 ""
7684$ ENDIF
7685$ echo4 " ''make'''makefile'", macros
7686$ echo4 ""
7687$!
a4521476
PP
7688$ IF ( F$SEARCH("config.msg").NES."" )
7689$ THEN
139df077
CB
7690$ echo4 "Hmm. I also noted the following information while running:"
7691$ echo4 ""
7692$ TYPE/OUTPUT=SYS$ERROR: config.msg
a4521476
PP
7693$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
7694$ DELETE/NOLOG/NOCONFIRM config.msg;
7695$ ENDIF
7696$!
97abc6ad 7697$Clean_up:
17d0565f 7698$ SET NOON
97abc6ad
HM
7699$ IF (silent)
7700$ THEN
17d0565f 7701$ CLOSE/NOLOG STDOUT
97abc6ad 7702$ DEASSIGN SYS$OUTPUT
97abc6ad 7703$ ENDIF
17d0565f 7704$ CLOSE/NOLOG CONFIG
414b89cc 7705$ IF F$GETJPI("","FILCNT").GT.vms_filcnt
97abc6ad
HM
7706$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
7707$ ENDIF
7708$ dflt = F$ENVIRONMENT("DEFAULT")
7709$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
7710$ THEN
1171624b
CB
7711$ IF ( F$SEARCH("[.CXX_REPOSITORY]*.*").NES."" )
7712$ THEN
7713$ DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
7714$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
7715$ ENDIF
97abc6ad
HM
7716$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
7717$ SET DEFAULT [-]
7718$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
7719$ DELETE/NOLOG/NOCONFIRM UU.DIR;
7720$ ENDIF
7721$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
97abc6ad
HM
7722$ EXIT
7723$!: End of Configure