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