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