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