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