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