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