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