This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Typo correction in perldebguts.pod
[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)
a3bd614a 631$ i_rp = i_rp + COLUMNS
bf25f2b5 632$ if i_rp .LT. len_rp THEN echo4 "''sub_rp'"
a3bd614a
PP
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 - "]"
fe05d1a7
PK
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]"
f688e3ac
CB
1493$ IF F$TYPE(scriptdir) .EQS. "" THEN -
1494 scriptdir ="''vms_prefix':[utils]"
570bb66e
JH
1495$ IF F$TYPE(sitearchexp) .EQS. "" THEN -
1496 sitearchexp ="''vms_prefix':[lib.site_perl.''archname']"
1497$ IF F$TYPE(sitelib_stem) .EQS. "" THEN -
1498 sitelib_stem ="''vms_prefix':[lib.site_perl]"
1499$ IF F$TYPE(sitelibexp) .EQS. "" THEN -
1500 sitelibexp ="''vms_prefix':[lib.site_perl]"
1501$!
97abc6ad 1502$!: see if we need a special compiler
01792a70 1503$! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
97abc6ad
HM
1504$!
1505$ nocc = "f"
1506$ vms_cc_dflt = ""
1507$ vms_cc_available = ""
1508$!
1509$ OPEN/WRITE CONFIG ccvms.c
570bb66e 1510$ WRITE CONFIG "#ifdef __DECC"
97abc6ad 1511$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
570bb66e 1512$ WRITE CONFIG "#endif"
97abc6ad
HM
1513$ WRITE CONFIG "#include <stdio.h>"
1514$ WRITE CONFIG "int main() {"
1515$ WRITE CONFIG "#ifdef __DECC"
1516$ WRITE CONFIG " printf(""/DECC\n"");"
1517$ WRITE CONFIG "#else"
1518$ WRITE CONFIG " printf(""/VAXC\n"");"
1519$ WRITE CONFIG "#endif"
1520$ WRITE CONFIG " exit(0);"
1521$ WRITE CONFIG "}"
1522$ CLOSE CONFIG
1523$!
5af06f0d
DS
1524$! DEFINE SYS$ERROR _NLA0:
1525$! DEFINE SYS$OUTPUT _NLA0:
97abc6ad
HM
1526$ cc/NoObj/list=ccvms.lis ccvms.c
1527$ tmp = $status
5af06f0d
DS
1528$! DEASSIGN SYS$OUTPUT
1529$! DEASSIGN SYS$ERROR
97abc6ad 1530$ IF (silent) THEN GOSUB Shut_up
97abc6ad
HM
1531$ IF tmp.NE.%X10B90001
1532$ THEN
1533$ IF tmp.NE.%X10000001
1534$ THEN
1535$ nocc = "t" !%X10000001 is return from gcc
1536$ GOTO Gcc_initial_check
1537$ ENDIF
1538$ ENDIF
1539$!
1540$ GOSUB List_Parse
1541$ IF .NOT.silent THEN echo ""
570bb66e 1542$ echo "Default ""cc"" is ''line' ''archsufx' ''F$GETSYI("VERSION")'"
97abc6ad
HM
1543$ IF F$LOCATE("VAX",line).NE.F$LENGTH(line)
1544$ THEN
97abc6ad
HM
1545$ IF .NOT.silent
1546$ THEN
570bb66e 1547$ echo "Will try cc/decc..."
97abc6ad 1548$ ENDIF
570bb66e
JH
1549$ DEFINE/USER_MODE SYS$ERROR NL:
1550$ DEFINE/USER_MODE SYS$OUTPUT NL:
97abc6ad
HM
1551$ SET NOON
1552$ cc/decc/NoObj/list=ccvms.lis ccvms.c
1553$ tmp = $status
97abc6ad
HM
1554$ SET ON
1555$ IF (silent) THEN GOSUB Shut_up
1556$ IF tmp.NE.%X10B90001
1557$ THEN
570bb66e 1558$ echo "Apparently you don't have that one."
97abc6ad
HM
1559$ ELSE
1560$ GOSUB List_parse
570bb66e 1561$ echo "You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
97abc6ad
HM
1562$ vms_cc_available = vms_cc_available + "cc/decc "
1563$ ENDIF
1564$ ELSE
5af06f0d 1565$ IF (F$LOCATE("DEC",line).NE.F$LENGTH(line)).or.(F$LOCATE("Compaq",line).NE.F$LENGTH(line))
97abc6ad
HM
1566$ THEN
1567$ vms_cc_dflt = "/decc"
1568$ vms_cc_available = vms_cc_available + "cc/decc "
97abc6ad
HM
1569$ ENDIF
1570$ ENDIF
1571$!
1572$Gcc_initial_check:
570bb66e 1573$ echo "Checking for gcc"
97abc6ad 1574$ OPEN/WRITE CONFIG gccvers.lis
570bb66e
JH
1575$ DEFINE/USER_MODE SYS$ERROR CONFIG
1576$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
97abc6ad
HM
1577$ 'gcc_symbol'/noobj/version _nla0:
1578$ tmp = $status
97abc6ad
HM
1579$ IF (silent) THEN GOSUB Shut_up
1580$ CLOSE CONFIG
1581$ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1582$ THEN
7558ebc2 1583$ echo "Symbol ""''gcc_symbol'"" is not defined. I guess you do not have it."
570bb66e
JH
1584$ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1585$ GOTO Cxx_initial_check
97abc6ad
HM
1586$ ENDIF
1587$ OPEN/READ CONFIG gccvers.lis
1588$GCC_List_Read:
1589$ READ/END_OF_FILE=GCC_List_End CONFIG line
1590$ GOTO GCC_List_Read
1591$GCC_List_End:
1592$ CLOSE CONFIG
1593$ echo line
1594$ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1595$ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1596$!
570bb66e
JH
1597$Cxx_initial_check:
1598$!
1599$! Do note that [vms]perl source files have a ways to go before they will
1600$! compile under CXX.
7558ebc2
PP
1601$! In order to test Configure.com with CXX invoke it with "-Dtry_cxx" on
1602$! the command line.
570bb66e 1603$!
7558ebc2
PP
1604$ IF F$TYPE(try_cxx) .EQS. "" THEN try_cxx := n
1605$ IF try_cxx .OR. try_cxx .EQS. "define"
570bb66e
JH
1606$!
1607$ THEN
1608$!
1609$ echo "Checking for CXX..."
1610$ OPEN/WRITE CONFIG ccvms.c
1611$ WRITE CONFIG "#include <iostream>"
1612$ WRITE CONFIG "int main() {"
1613$ WRITE CONFIG "#ifdef __DECCXX"
1614$ WRITE CONFIG " cout << __DECCXX, endl;"
1615$ WRITE CONFIG "#else"
1616$ WRITE CONFIG " cout << 0,endl;"
1617$ WRITE CONFIG "#endif"
1618$! Todo: add G++ identifier check ??
1619$ WRITE CONFIG " return(0);"
1620$ WRITE CONFIG "}"
1621$ CLOSE CONFIG
1622$ SET NOON
1623$ DEFINE/USER_MODE SYS$OUTPUT NL:
1624$ DEFINE/USER_MODE SYS$ERROR NL:
1625$ cxx ccvms.c
1626$ tmp = $status
1627$ SET ON
1628$! success $status with:
1629$! DEC C++ V1.1-001 on VMS VAX V5.5-2
1630$! DEC C++ V5.6-013 on OpenVMS VAX V7.1
1631$! DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1632$! Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1633$ IF tmp .eq. %X15F60001
1634$ THEN
1635$! Which linker?
1636$ SET NOON
1637$ DEFINE/USER_MODE SYS$OUTPUT NL:
1638$ DEFINE/USER_MODE SYS$ERROR NL:
1639$ link ccvms.obj
1640$ tmp = $status
1641$ SET ON
1642$ ! success $status with:
1643$ ! link && DEC C++ V1.1-001 on VMS VAX V5.5-2
1644$ ! link && DEC C++ V5.6-013 on OpenVMS VAX V7.1
1645$ IF tmp .eq. %X10000001
1646$ THEN
1647$ ld_try = "Link"
1648$ vms_cc_available = vms_cc_available + "cxx "
1649$ echo "CXX and LINK are available."
1650$ ELSE
1651$ IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1652$ SET NOON
1653$ DEFINE/USER_MODE SYS$OUTPUT NL:
1654$ DEFINE/USER_MODE SYS$ERROR NL:
1655$ cxxlink ccvms.obj
1656$ tmp = $status
1657$ SET ON
1658$ ! success $status with:
1659$ ! cxxlink && DEC C++ V6.1-003 on OpenVMS Alpha V7.1
1660$ ! cxxlink && Compaq C++ V6.2-016 for OpenVMS Alpha V7.2-1
1661$ IF tmp .eq. %X10000001
1662$ THEN
1663$ ld_try = "cxxlink"
1664$ vms_cc_available = vms_cc_available + "cxx "
1665$ echo "CXX and CXXLINK are available."
1666$ ENDIF
1667$ ENDIF
1668$ IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1669$ ELSE
1670$ echo "Nope."
1671$ ENDIF
1672$ DELETE/NOLOG/NOCONFIRM ccvms.c;
1673$ IF F$SEARCH("ccvms.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.obj;
1674$ CALL Cxx_demangler_cleanup
1675$!
1676$ ENDIF ! 1 .eq. 0 or 1 .eq. 1
1677$!
97abc6ad
HM
1678$CC_Cleanup:
1679$ DELETE/NOLOG/NOCONFIRM ccvms.*;
1680$CC_Desired:
1681$!: see if we need a special compiler
1682$! echo ""
570bb66e 1683$ echo "Available compiler(s):"
97abc6ad
HM
1684$ echo "( ''vms_cc_available')"
1685$ IF .NOT.nocc
1686$ THEN
1687$ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1688$ ELSE
1689$ dflt = gcc_symbol
1690$ ENDIF
1691$ rp = "Use which C compiler? [''dflt'] "
1692$ GOSUB myread
1693$ IF ans.NES.""
1694$ THEN
1695$ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
1696$ Mcc = ans
5af06f0d 1697$ IF (F$LOCATE("dec",ans).NE.F$LENGTH(ans)).or.(F$LOCATE("compaq",ans).NE.F$LENGTH(ans))
97abc6ad
HM
1698$ THEN
1699$ Mcc = "cc/decc"
414b89cc
CB
1700$! CPQ ?
1701$ ccname := DEC
429a5e67 1702$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1703$ ENDIF
570bb66e
JH
1704$ IF F$LOCATE("cxx",F$EDIT(ans,"COLLAPSE,LOWERCASE")) .NE. F$LENGTH(ans)
1705$ THEN
1706$ Mcc = "cxx"
414b89cc 1707$ ccname := CXX
570bb66e 1708$ ld = ld_try
7558ebc2
PP
1709$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1710$ ELSE ! Not_cxx
1711$ IF Mcc.NES.dflt
97abc6ad 1712$ THEN
7558ebc2
PP
1713$ IF F$LOCATE("dec",dflt) .NE. F$LENGTH(dflt) .or. -
1714 F$LOCATE("compaq",dflt) .NE. F$LENGTH(dflt)
1715$ THEN
1716$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1717$ ELSE
414b89cc 1718$ ccname := DEC
7558ebc2
PP
1719$ ENDIF
1720$ ELSE
1721$ IF Mcc .EQS. "cc/decc"
1722$ THEN
414b89cc 1723$ ccname := DEC
7558ebc2
PP
1724$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1725$ ENDIF
97abc6ad
HM
1726$ ENDIF
1727$ ENDIF
1728$ ELSE
1729$ Mcc = dflt
1730$ IF Mcc .EQS. "cc/decc"
1731$ THEN
414b89cc 1732$ ccname := DEC
429a5e67 1733$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad 1734$ ENDIF
97abc6ad
HM
1735$ IF Mcc .EQS. "gcc"
1736$ THEN
414b89cc 1737$ ccname := GCC
429a5e67 1738$ C_COMPILER_Replace = "CC=cc=''Mcc'"
97abc6ad
HM
1739$ ENDIF
1740$ ENDIF
1741$Decc_Version_check:
570bb66e 1742$ ccversion=""
414b89cc 1743$ IF ccname .EQS. "DEC"
97abc6ad
HM
1744$ THEN
1745$ echo ""
7558ebc2 1746$ echo4 "Checking for the Dec C version number..."
97abc6ad
HM
1747$ OPEN/WRITE CONFIG deccvers.c
1748$ WRITE CONFIG "#include <stdlib.h>" !DECC is sooo picky
1749$ WRITE CONFIG "#include <stdio.h>"
1750$ WRITE CONFIG "int main() {"
1751$ WRITE CONFIG "#ifdef __DECC"
1752$ WRITE CONFIG "#ifdef __DECC_VER"
1753$ WRITE CONFIG " printf(""%i\n"", __DECC_VER);"
1754$ WRITE CONFIG "#else"
1755$ WRITE CONFIG " printf(""%i\n"", ""1"");"
1756$ WRITE CONFIG "#endif"
1757$ WRITE CONFIG "#endif"
1758$ WRITE CONFIG " exit(0);"
1759$ WRITE CONFIG "}"
1760$ CLOSE CONFIG
570bb66e
JH
1761$ SET NOON
1762$ DEFINE/USER_MODE SYS$ERROR NL:
1763$ DEFINE/USER_MODE SYS$OUTPUT NL:
97abc6ad
HM
1764$ 'Mcc' deccvers.c
1765$ tmp = $status
97abc6ad 1766$ IF (silent) THEN GOSUB Shut_up
570bb66e
JH
1767$ DEFINE/USER_MODE SYS$ERROR NL:
1768$ DEFINE/USER_MODE SYS$OUTPUT NL:
97abc6ad
HM
1769$ link deccvers.obj
1770$ tmp = $status
97abc6ad
HM
1771$ IF (silent) THEN GOSUB Shut_up
1772$ OPEN/WRITE CONFIG deccvers.out
570bb66e
JH
1773$ DEFINE/USER_MODE SYS$ERROR CONFIG
1774$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
97abc6ad
HM
1775$ mcr []deccvers.exe
1776$ tmp = $status
570bb66e 1777$ SET ON
97abc6ad 1778$ CLOSE CONFIG
97abc6ad
HM
1779$ IF (silent) THEN GOSUB Shut_up
1780$ OPEN/READ CONFIG deccvers.out
1781$ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1782$Dec_c_cleanup:
1783$ CLOSE CONFIG
97abc6ad 1784$ echo "You are using Dec C ''line'"
570bb66e
JH
1785$ ccversion = line
1786$ Dec_C_Version = F$INTEGER(line)
1787$ IF Dec_C_Version .GE. 60200000
1788$ THEN
1789$ echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
1790$ ccflags = ccflags + "/NOANSI_ALIAS"
1791$ ENDIF
1792$ DELETE/NOLOG/NOCONFIRM deccvers.*;
97abc6ad 1793$ ENDIF
97abc6ad 1794$Gcc_check:
570bb66e 1795$ gccversion = ""
414b89cc 1796$ IF ccname .EQS. "GCC"
97abc6ad 1797$ THEN
570bb66e
JH
1798$ vaxcrtl_olb = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1799$ vaxcrtl_exe = F$SEARCH("SYS$SHARE:VAXCRTL.EXE")
1800$ gcclib_olb = F$SEARCH("GNU_CC:[000000]GCCLIB.OLB")
1801$ IF gcclib_olb .EQS. ""
97abc6ad 1802$ THEN
570bb66e
JH
1803$! These objects/libs come w/ gcc 2.7.2 for AXP:
1804$ tmp = F$SEARCH("GNU_CC:[000000]libgcc2.olb")
1805$ IF tmp .NES. "" then gcclib_olb = tmp
1806$ tmp = F$SEARCH("GNU_CC:[000000]libgcclib.olb")
1807$ IF tmp .NES. ""
1808$ THEN
1809$ IF gcclib_olb .EQS. ""
1810$ THEN gcclib_olb = tmp
1811$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1812$ ENDIF
97abc6ad 1813$ ENDIF
570bb66e
JH
1814$ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1815$ IF tmp .NES. ""
1816$ THEN
1817$ IF gcclib_olb .EQS. ""
1818$ THEN gcclib_olb = tmp
1819$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1820$ ENDIF
97abc6ad 1821$ ENDIF
570bb66e
JH
1822$ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1823$ IF tmp .NES. ""
1824$ THEN
1825$ IF gcclib_olb .EQS. ""
1826$ THEN gcclib_olb = tmp
1827$ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1828$ ENDIF
97abc6ad 1829$ ENDIF
570bb66e
JH
1830$ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1831$ ELSE
1832$ gcclib_olb = gcclib_olb + "/lib"
97abc6ad 1833$ ENDIF
570bb66e 1834$ IF gcclib_olb .NES. "" .AND. -
97abc6ad
HM
1835 (vaxcrtl_olb .NES. "" .OR. -
1836 vaxcrtl_exe .NES. "" )
570bb66e
JH
1837$ THEN
1838$ echo ""
1839$ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1840$ OPEN/WRITE CONFIG gccvers.c
570bb66e
JH
1841$ WRITE CONFIG "#include <stdio.h>"
1842$ WRITE CONFIG "int main() {"
1843$ WRITE CONFIG "#ifdef __GNUC__"
1844$ WRITE CONFIG "#ifdef __VERSION__"
1845$ WRITE CONFIG " printf(""%s\n"", __VERSION__);"
1846$ WRITE CONFIG "#else"
1847$ WRITE CONFIG " printf(""%s\n"", ""1"");"
1848$ WRITE CONFIG "#endif"
1849$ WRITE CONFIG "#endif"
1850$ WRITE CONFIG " exit(0);"
1851$ WRITE CONFIG "}"
1852$ CLOSE CONFIG
1853$ DEFINE SYS$ERROR _NLA0:
1854$ DEFINE SYS$OUTPUT _NLA0:
1855$ 'Mcc' gccvers.c
1856$ tmp = $status
1857$ DEASSIGN SYS$ERROR _NLA0:
1858$ DEASSIGN SYS$OUTPUT _NLA0:
1859$ IF (silent) THEN GOSUB Shut_up
1860$ DEFINE SYS$ERROR _NLA0:
1861$ DEFINE SYS$OUTPUT _NLA0:
1862$ IF vaxcrtl_exe .EQS. ""
1863$ THEN
1864$ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1865$ THEN
1866$ link gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1867$ tmp = $status
1868$ ELSE
1869$ link gccvers.obj,'gcclib_olb'
1870$ tmp = $status
1871$ ENDIF
1872$ ELSE
1873$ OPEN/WRITE CONFIG GCCVERS.OPT
1874$ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1875$ CLOSE CONFIG
1876$ link gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
1877$ tmp = $status
1878$ ENDIF
1879$ DEASSIGN SYS$ERROR
1880$ DEASSIGN SYS$OUTPUT
1881$ IF (silent) THEN GOSUB Shut_up
1882$ OPEN/WRITE CONFIG gccvers.out
1883$ DEFINE SYS$ERROR CONFIG
1884$ DEFINE SYS$OUTPUT CONFIG
1885$ mcr []gccvers.exe
1886$ tmp = $status
1887$ CLOSE CONFIG
1888$ DEASSIGN SYS$OUTPUT
1889$ DEASSIGN SYS$ERROR
1890$ IF (silent) THEN GOSUB Shut_up
1891$ OPEN/READ CONFIG gccvers.out
1892$ READ/END_OF_FILE=Gcc_cleanup CONFIG line
1893$Gcc_cleanup:
1894$ CLOSE CONFIG
1895$ DELETE/NOLOG/NOCONFIRM gccvers.*;
1896$ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1897$ THEN
1898$ echo "You are not using GNU cc."
1899$ GOTO Host_name
1900$ ELSE
1901$ echo "You are using GNU cc ''line'"
1902$ gccversion = line
414b89cc 1903$ ccname := "GCC"
570bb66e
JH
1904$ C_COMPILER_Replace = "CC=cc=''Mcc'"
1905$ GOTO Include_dirs
1906$ ENDIF
1907$ ENDIF
1908$ ENDIF
1909$Cxx_Version_check:
414b89cc 1910$ IF ccname .EQS. "CXX"
97abc6ad 1911$ THEN
570bb66e 1912$ OPEN/WRITE CONFIG cxxvers.c
97abc6ad
HM
1913$ WRITE CONFIG "#include <stdio.h>"
1914$ WRITE CONFIG "int main() {"
570bb66e
JH
1915$ WRITE CONFIG "#ifdef __DECCXX_VER"
1916$ WRITE CONFIG " printf(""%i\n"", __DECCXX_VER);"
97abc6ad 1917$ WRITE CONFIG "#else"
570bb66e 1918$ WRITE CONFIG " printf(""%i\n"", ""0"");"
97abc6ad 1919$ WRITE CONFIG "#endif"
570bb66e 1920$ WRITE CONFIG " return(0);"
97abc6ad
HM
1921$ WRITE CONFIG "}"
1922$ CLOSE CONFIG
570bb66e
JH
1923$ SET NOON
1924$ DEFINE/USER_MODE SYS$ERROR NL:
1925$ DEFINE/USER_MODE SYS$OUTPUT NL:
1926$ 'Mcc' cxxvers.c
97abc6ad 1927$ tmp = $status
570bb66e 1928$ SET ON
97abc6ad 1929$ IF (silent) THEN GOSUB Shut_up
570bb66e
JH
1930$ SET NOON
1931$ DEFINE/USER_MODE SYS$ERROR NL:
1932$ DEFINE/USER_MODE SYS$OUTPUT NL:
1933$ 'ld' cxxvers.obj
1934$ tmp = $status
1935$ SET ON
97abc6ad 1936$ IF (silent) THEN GOSUB Shut_up
570bb66e
JH
1937$ OPEN/WRITE CONFIG cxxvers.out
1938$ SET NOON
1939$ DEFINE/USER_MODE SYS$ERROR CONFIG
1940$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1941$ mcr []cxxvers.exe
97abc6ad 1942$ tmp = $status
570bb66e 1943$ SET ON
97abc6ad 1944$ CLOSE CONFIG
97abc6ad 1945$ IF (silent) THEN GOSUB Shut_up
570bb66e
JH
1946$ OPEN/READ CONFIG cxxvers.out
1947$ READ/END_OF_FILE=Cxx_cleanup CONFIG line
1948$Cxx_cleanup:
97abc6ad 1949$ CLOSE CONFIG
570bb66e
JH
1950$ DELETE/NOLOG/NOCONFIRM cxxvers.*;
1951$ echo "You are using CXX ''line'"
1952$ cxxversion = line
1953$ ccversion = line
1954$ CALL Cxx_demangler_cleanup
1955$ ENDIF
1956$!
1957$Cxx_demangler_cleanup: SUBROUTINE
1958$!
1959$! If we do build with CXX these demangler Dbs will be left all over.
1960$! However, configure.com does try to remove the [.UU] sub directory.
1961$! Be sure to set default to the correct place before calling this sub.
1962$!
1963$ SET NOON
1964$ IF F$SEARCH("[.CXX_REPOSITORY]*.*") .NES. "" THEN DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
1965$ IF F$SEARCH("CXX_REPOSITORY.DIR") .NES. ""
1966$ THEN
1967$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
1968$ DELETE/NOLOG/NOCONFIRM CXX_REPOSITORY.DIR;
97abc6ad 1969$ ENDIF
570bb66e
JH
1970$ SET ON
1971$ EXIT
1972$ ENDSUBROUTINE ! Cxx_demangler_cleanup
1973$!
97abc6ad
HM
1974$ GOTO Host_name
1975$!
1976$List_Parse:
1977$ OPEN/READ CONFIG ccvms.lis
1978$ READ CONFIG line
55315086 1979$ IF archname .EQS. "VMS_VAX"
97abc6ad
HM
1980$ THEN
1981$ read CONFIG line
1982$ archsufx = "VAX"
1983$ ELSE
1984$ archsufx = "AXP"
1985$ ENDIF
1986$ CLOSE CONFIG
1987$ line = F$EDIT(line,"TRIM,COMPRESS")
1988$ line = line - "Page 1" ! occurs at end all compilers
1989$ line = line - "CCVMS " ! filename appears w/ VAXC
1990$ line = line - "Source Listing " ! Seen w/ AXP DECC
1991$ tmp = F$EXTRACT(0,20,line) !timestamp, e.g. "30-JUL-1996 21:12:54 "
1992$ line = line - tmp
1993$ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1994$ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1995$ RETURN
1996$!
1997$Include_dirs:
570bb66e 1998$!: What should the include directory be ? (.TLB text libraries)
97abc6ad
HM
1999$ dflt = gcclib_olb
2000$ rp = "Where are the include files you want to use? "
2001$ IF f$length( rp + "[''dflt'] " ).gt.76
2002$ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
2003$ ELSE rp = rp + "[''dflt'] "
2004$ ENDIF
2005$ GOSUB myread
2006$ usrinc = ans
2007$!
2008$!: see if we have to deal with yellow pages, now NIS.
2009$!: now get the host name
2010$Host_name:
2011$ echo ""
2012$ echo4 "Figuring out host name..." !>&4
2013$ myhostname = ""
2014$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("ARPANET_HOST_NAME")
2015$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("INTERNET_HOST_NAME")
2016$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("MULTINET_HOST_NAME")
2017$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("UCX$INET_HOST_NAME")
2018$ IF myhostname.eqs."".and. -
2019 F$TRNLNM("UCX$INET_HOST") .nes. "" .and. -
2020 F$TRNLNM("UCX$INET_DOMAIN") .nes. "" THEN -
2021 myhostname = F$TRNLNM("UCX$INET_HOST") + "." + F$TRNLNM("UCX$INET_DOMAIN")
16421035
PP
2022$ IF myhostname.eqs."".and. -
2023 F$TRNLNM("TCPIP$INET_HOST") .nes. "" .and. -
2024 F$TRNLNM("TCPIP$INET_DOMAIN") .nes. "" THEN -
2025 myhostname = F$TRNLNM("TCPIP$INET_HOST") + "." + F$TRNLNM("TCPIP$INET_DOMAIN")
97abc6ad
HM
2026$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("TCPWARE_DOMAINNAME")
2027$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("NEWS_ADDRESS")
2028$ IF myhostname.eqs."" THEN myhostname = F$TRNLNM("SYS$NODE") - "::"
2029$ IF myhostname.eqs."" THEN myhostname = F$EDIT(F$GETSYI("SCSNODE"),"TRIM")
2030$!: you do not want to know about this
2031$!: verify guess
2032$ rp = "Your host name appears to be """"''myhostname'"""". Right? "
2033$ GOSUB myread
2034$ IF (.not.ans).and.(ans.NES."")
2035$ THEN
2036$ READ SYS$COMMAND/PROMPT= -
2037 "Please type the (one word) name of your host: " ans
2038$ myhostname = ans
2039$ ENDIF
2040$!: translate upper to lower if necessary
2041$ myhostname = F$EDIT(myhostname,"COLLAPSE")
2042$ mylowhostname = F$EDIT(myhostname," LOWERCASE")
2043$ IF mylowhostname.NES.myhostname
2044$ THEN
2045$ echo "(Normalizing case in your host name)"
2046$ myhostname = mylowhostname
2047$ ENDIF
2048$!
2049$ fp = F$LOCATE(".",myhostname)
2050$ mydomain = F$EXTRACT(fp,(F$LENGTH(myhostname)-fp)+1,myhostname)
2051$ IF mydomain.NES."" !no periods in DECnet names like "MYDECNODE::"
2052$ THEN
2053$ rp = "What is your domain name? [''mydomain'] "
2054$ GOSUB myread
cc391245 2055$ IF ans .nes. "" THEN mydomain = ans
97abc6ad
HM
2056$!: translate upper to lower if necessary
2057$ mydomain = F$EDIT(mydomain,"COLLAPSE")
2058$ mylowdomain = F$EDIT(mydomain," LOWERCASE")
2059$ IF mylowdomain.NES.mydomain
2060$ THEN
2061$ echo "(Normalizing case in your domain name)"
2062$ mydomain = mylowdomain
2063$ ENDIF
2064$ ENDIF
2065$ myhostname = myhostname - mydomain
2066$ echo "(Trimming domain name from host name--host name is now ''myhostname')"
2067$ IF .NOT.silent
7558ebc2
PP
2068$ THEN
2069$ TYPE SYS$INPUT:
2070$ DECK
97abc6ad
HM
2071
2072I need to get your e-mail address in Internet format if possible, i.e.
2073something like user@host.domain. Please answer accurately since I have
2074no easy means to double check it. The default value provided below
2075is most probably close to the reality but may not be valid from outside
2076your organization...
7558ebc2 2077$ EOD
97abc6ad 2078$ ENDIF
414b89cc
CB
2079$ IF F$TYPE(cf_email) .EQS. ""
2080$ THEN
2081$ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
2082$ rp = "What is your e-mail address? [''dflt'] "
2083$ GOSUB myread
2084$ IF ans .nes. ""
2085$ THEN cf_email = ans
2086$ ELSE cf_email = dflt
2087$ ENDIF
97abc6ad
HM
2088$ ENDIF
2089$!
2090$ IF .NOT.silent
7558ebc2
PP
2091$ THEN
2092$ TYPE SYS$INPUT:
2093$ DECK
97abc6ad
HM
2094
2095If you or somebody else will be maintaining perl at your site, please
2096fill in the correct e-mail address here so that they may be contacted
2097if necessary. Currently, the "perlbug" program included with perl
2098will send mail to this address in addition to perlbug@perl.com. You may
2099enter "none" for no administrator.
7558ebc2 2100$ EOD
97abc6ad
HM
2101$ ENDIF
2102$ dflt = "''cf_email'"
2103$ rp = "Perl administrator e-mail address [''dflt'] "
2104$ GOSUB myread
cc391245 2105$ IF ans .nes. ""
97abc6ad
HM
2106$ THEN perladmin = ans
2107$ ELSE perladmin = dflt
2108$ ENDIF
2109$!
2110$!: determine where public executable scripts go
2111$!: determine perl absolute location
2112$!: figure out how to guarantee perl startup
2113$!
2114$!: see how we invoke the C preprocessor
2115$! echo ""
2116$! echo4 "Now, how can we feed standard input to your C preprocessor..." !>&4
2117$!: Set private lib path
2118$!: Now check and see which directories actually exist, avoiding duplicates
2119$!: determine optimize, if desired, or use for debug flag also
2120$!: We will not override a previous value, but we might want to
2121$!: augment a hint file
2122$!: the following weeds options from ccflags that are of no interest to cpp
2123$!: flags used in final linking phase
2124$!: Try to guess additional flags to pick up local libraries.
2125$!: coherency check
2126$! echo ""
2127$! echo4 "Checking your choice of C compiler and flags for coherency..." !>&4
2128$!: compute shared library extension
2129$!: Looking for optional libraries
2130$!: see if nm is to be used to determine whether a symbol is defined or not
2131$!: get list of predefined functions in a handy place
983dbef6 2132$!: see if we have sigaction or sigprocmask
97abc6ad
HM
2133$!: see whether socketshr exists
2134$ IF (F$SEARCH(F$PARSE("SocketShr","Sys$Share:.Exe")).NES."")
2135$ THEN
570bb66e 2136$ Has_socketshr = "T"
97abc6ad 2137$ echo ""
7558ebc2 2138$ echo4 "Hmm... Looks like you have SOCKETSHR Berkeley networking support."
570bb66e
JH
2139$ ELSE
2140$ Has_socketshr = "F"
2141$ ENDIF
414b89cc
CB
2142$ IF (ccname .EQS. "DEC" .AND. Dec_C_Version .GE. 50200000) .OR. -
2143 (ccname .EQS. "CXX")
97abc6ad
HM
2144$ THEN
2145$ Has_Dec_C_Sockets = "T"
2146$ echo ""
7558ebc2 2147$ echo4 "Hmm... Looks like you have Dec C Berkeley networking support."
570bb66e
JH
2148$ ELSE
2149$ Has_Dec_C_Sockets = "F"
97abc6ad
HM
2150$ ENDIF
2151$ ! Hey, we've got both. Default to Dec C, then, since it's better
570bb66e 2152$ IF Has_socketshr .OR. Has_Dec_C_Sockets
97abc6ad
HM
2153$ THEN
2154$ echo ""
7558ebc2
PP
2155$ echo "You have sockets available. Which socket stack do you want to"
2156$ echo "build into Perl?"
570bb66e 2157$ IF Has_Dec_C_Sockets
97abc6ad
HM
2158$ THEN
2159$ dflt = "DECC"
2160$ else
e6df7ed1 2161$ dflt = "SOCKETSHR"
97abc6ad
HM
2162$ endif
2163$ rp = "Choose socket stack (NONE"
570bb66e
JH
2164$ IF Has_socketshr THEN rp = rp + ",SOCKETSHR"
2165$ IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
97abc6ad
HM
2166$ rp = rp + ") [''dflt'] "
2167$ GOSUB myread
570bb66e
JH
2168$ IF ans .EQS. "" THEN ans = "''dflt'"
2169$ Has_Dec_C_Sockets = "F"
2170$ Has_socketshr = "F"
97abc6ad 2171$ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
570bb66e
JH
2172$ IF ans.eqs."decc" then Has_Dec_C_Sockets = "T"
2173$ IF ans.eqs."socketshr" then Has_socketshr = "T"
2174$ ENDIF
97abc6ad
HM
2175$!
2176$!
3eeba6fb 2177$! Ask if they want to build with VMS_DEBUG perl
146174a9 2178$ echo ""
3eeba6fb
CB
2179$ echo "Perl can be built to run under the VMS debugger."
2180$ echo "You should only select this option if you are debugging"
2181$ echo "perl itself. This can be a useful feature if you are "
2182$ echo "embedding perl in a program."
146174a9 2183$ dflt = "n"
3eeba6fb
CB
2184$ rp = "Build a VMS-DEBUG version of Perl? [''dflt'] "
2185$ GOSUB myread
146174a9
CB
2186$ IF ans.eqs."" then ans = dflt
2187$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
3eeba6fb
CB
2188$ THEN
2189$ use_vmsdebug_perl = "Y"
2190$ macros = macros + """__DEBUG__=1"","
2191$ ELSE
2192$ use_vmsdebug_perl = "N"
2193$ ENDIF
2194$!
8c99d73e
GS
2195$! Ask if they want to build with DEBUGGING
2196$ echo ""
7558ebc2
PP
2197$ echo "Perl can be built with extra runtime debugging enabled. This"
2198$ echo "enables the -D switch, at the cost of some performance. It"
2199$ echo "was mandatory on perl 5.005 and before on VMS, but is now"
2200$ echo "optional. If you do not generally use it you should probably"
2201$ echo "leave this off and gain a bit of extra speed."
8c99d73e
GS
2202$ dflt = "y"
2203$ rp = "Build a DEBUGGING version of Perl? [''dflt'] "
2204$ GOSUB myread
2205$ IF ans.eqs."" then ans = dflt
2206$ IF F$EXTRACT(0, 1, F$EDIT(ans,"COLLAPSE,UPCASE")) .eqs. "Y"
2207$ THEN
2208$ use_debugging_perl = "Y"
2209$ ELSE
2210$ use_debugging_perl = "N"
2211$ ENDIF
2212$!
3937c24e 2213$! Ask if they want to build with MULTIPLICITY
146174a9 2214$ echo ""
570bb66e
JH
2215$ echo "Perl can be built so that multiple Perl interpreters can coexist"
2216$ echo "within the same Perl executable."
7558ebc2
PP
2217$ echo "There is some performance overhead, however, so you"
2218$ echo "probably do not want to choose this unless you are going to be"
2219$ echo "doing things with embedded perl."
3937c24e 2220$ dflt = "n"
570bb66e 2221$ rp = "Build Perl for multiplicity? [''dflt'] "
3937c24e 2222$ GOSUB myread
570bb66e
JH
2223$ IF ans.eqs."" then ans = dflt
2224$ IF ans
3937c24e 2225$ THEN
570bb66e 2226$ usemultiplicity="define"
3937c24e 2227$ ELSE
570bb66e 2228$ usemultiplicity="undef"
3937c24e 2229$ ENDIF
fafa4fee
CB
2230$!
2231$! Ask if they want to build with 64-bit support
570bb66e 2232$ IF (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
fafa4fee 2233$ THEN
842bcadf
CB
2234$ dflt = "n"
2235$ IF F$TYPE(use64bitint) .NES. ""
2236$ THEN
2237$ IF use64bitint .OR. use64bitint .eqs. "define" THEN dflt = "y"
2238$ ENDIF
fafa4fee 2239$ echo ""
7558ebc2 2240$ echo "You can have native 64-bit long integers."
f53b4005 2241$ echo ""
7558ebc2
PP
2242$ echo "Perl can be built to take advantage of 64-bit integer types"
2243$ echo "on some systems, which provide a much larger range for perl's"
2244$ echo "mathematical operations. (Note that does *not* enable 64-bit"
f53b4005 2245$ echo "fileops at the moment, as Dec C doesn't do that yet)."
7558ebc2 2246$ echo "Choosing this option will most probably introduce binary incompatibilities."
f53b4005 2247$ echo ""
7558ebc2 2248$ echo "If this does not make any sense to you, just accept the default ''dflt'."
f53b4005 2249$ rp = "Try to use 64-bit integers, if available? [''dflt'] "
5e4ba136 2250$ GOSUB myread
f53b4005 2251$ IF ans .EQS. "" THEN ans = dflt
7558ebc2
PP
2252$ IF ans
2253$ THEN use64bitint="Y"
2254$ ELSE use64bitint="N"
5e4ba136 2255$ ENDIF
842bcadf
CB
2256$!
2257$ dflt = "n"
2258$ IF F$TYPE(use64bitall) .NES. ""
2259$ THEN
2260$ IF use64bitall .OR. use64bitall .eqs. "define" THEN dflt = "y"
2261$ ENDIF
2262$ echo ""
2263$ echo "You may also choose to try maximal 64-bitness. It means using as much"
2264$ echo "64-bitness as possible on the platform. This in turn means even more"
2265$ echo "binary incompatibilities. On the other hand, your platform may not"
2266$ echo "have any more 64-bitness available than what you already have chosen."
2267$ echo ""
2268$ echo "If this does not make any sense to you, just accept the default ''dflt'."
2269$ rp = "Try to use maximal 64-bit support, if available? [''dflt'] "
2270$ GOSUB myread
2271$ IF ans .EQS. "" THEN ans = dflt
2272$ IF ans
2273$ THEN use64bitall="Y"
2274$ ELSE use64bitall="N"
2275$ ENDIF
2276$ IF use64bitall .AND. .NOT. use64bitint
f53b4005 2277$ THEN
f53b4005 2278$ echo ""
842bcadf
CB
2279$ echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
2280$ echo "the use of 64-bit integers."
2281$ use64bitint="Y"
f53b4005
CB
2282$ ENDIF
2283$ ENDIF ! AXP && >= 7.1
146174a9 2284$!
97abc6ad 2285$! Ask about threads, if appropriate
414b89cc 2286$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
97abc6ad 2287$ THEN
146174a9 2288$ echo ""
7558ebc2
PP
2289$ echo "This version of Perl can be built with threads. While really nifty,"
2290$ echo "they are a beta feature, and there is a speed penalty for perl"
2291$ echo "programs if you build with threads *even if you do not use them*."
429a5e67 2292$ dflt = "n"
97abc6ad
HM
2293$ rp = "Build with threads? [''dflt'] "
2294$ GOSUB myread
2295$ if ans.eqs."" then ans = dflt
2296$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
2297$ THEN
2298$ use_threads="T"
498336ed 2299$ ! Shall we do the 5.005-stype threads, or IThreads?
7558ebc2
PP
2300$ echo "As of 5.5.640, Perl has two different internal threading"
2301$ echo "implementations, the 5.005 version (5005threads) and an"
2302$ echo "interpreter-based version (ithreads) that has one"
2303$ echo "interpreter per thread. Both are very experimental. This"
2304$ echo "arrangement exists to help developers work out which one"
2305$ echo "is better."
2306$ echo ""
2307$ echo "If you are a casual user, you probably do not want"
2308$ echo "interpreter-threads at this time. There doesn't yet exist"
2309$ echo "a way to create threads from within Perl in this model,"
2310$ echo "i.e., ""use Thread;"" will NOT work."
2311$ echo ""
498336ed 2312$ dflt = "n"
7558ebc2 2313$ rp = "Build with Interpreter threads? [''dflt'] "
2974eb71 2314$ GOSUB myread
498336ed
CB
2315$ if ans.eqs."" then ans = dflt
2316$ if (f$extract(0, 1, "''ans'").eqs."Y").or.(f$extract(0, 1, "''ans'").eqs."y")
2317$ THEN
2318$ use_ithreads="Y"
2319$ use_5005_threads="N"
2320$ ELSE
2321$ use_ithreads="N"
2322$ use_5005_threads="Y"
2323$ ENDIF
429a5e67 2324$ ! Are they on VMS 7.1 on an alpha?
570bb66e 2325$ if (archname.eqs."VMS_AXP").and.("''f$extract(1,3, f$getsyi(""version""))'".ges."7.1")
429a5e67
DS
2326$ THEN
2327$ echo ""
7558ebc2
PP
2328$ echo "Threaded perl can be linked to use multiple kernel threads"
2329$ echo "and system upcalls on VMS 7.1+ on Alpha systems. This feature"
2330$ echo "allows multiple threads to execute simultaneously on an SMP"
2331$ echo "system as well as preventing a single thread from blocking"
2332$ echo "all the threads in a program, even on a single-processor"
2333$ echo "machine. Unfortunately, this feature isn't safe on an"
2334$ echo "unpatched 7.1 system (several OS patches were required when"
2335$ echo "this procedure was written)."
e6df7ed1 2336$ dflt = "n"
429a5e67
DS
2337$ rp = "Enable multiple kernel threads and upcalls? [''dflt'] "
2338$ gosub myread
2339$ if ans.eqs."" then ans="''dflt'"
2340$ if f$extract(0, 1, f$edit(ans,"TRIM,COMPRESS,UPCASE")).eqs."Y"
2341$ THEN
2342$ Thread_Live_Dangerously = "MT=MT=1"
2343$ ENDIF
2344$ ENDIF
97abc6ad
HM
2345$ ENDIF
2346$ ENDIF
7558ebc2
PP
2347$ IF archname .EQS. "VMS_AXP"
2348$ THEN
498336ed 2349$! Case sensitive?
7558ebc2
PP
2350$ echo ""
2351$ echo "By default, perl (and pretty much everything else on VMS) uses"
2352$ echo "case-insensitive linker symbols. Which is to say, when the"
2353$ echo "underlying C code makes a call to a routine called Perl_foo in"
2354$ echo "the source, the name in the object modules or shareable images"
2355$ echo "is really PERL_FOO. There are some packages that use an"
2356$ echo "embedded perl interpreter that instead require case-sensitive"
2357$ echo "linker symbols."
2358$ echo ""
2359$ echo "If you have no idea what this means, and do not have"
2360$ echo "any program requiring anything, choose the default."
2361$ dflt = be_case_sensitive
2362$ rp = "Build with case-sensitive symbols? [''dflt'] "
2363$ GOSUB myread
2364$ IF ans .EQS. "" THEN ans="''dflt'"
2365$ be_case_sensitive = "''ans'"
498336ed 2366$! IEEE math?
7558ebc2 2367$ echo ""
24866caa
CB
2368$ echo "Perl normally uses IEEE format (T_FLOAT) floating point numbers"
2369$ echo "internally on Alpha, but if you need G_FLOAT for binary compatibility"
2370$ echo "with an external library or existing data, you may wish to disable"
2371$ echo "the IEEE math option."
7558ebc2
PP
2372$ dflt = use_ieee_math
2373$ rp = "Use IEEE math? [''dflt'] "
2374$ GOSUB myread
2375$ IF ans .eqs. "" THEN ans = "''dflt'"
2376$ use_ieee_math = "''ans'"
bb6f4497
CL
2377$ ELSE
2378$ be_case_sensitive = "n"
2379$ use_ieee_math = "n"
7558ebc2 2380$ ENDIF
498336ed
CB
2381$! CC Flags
2382$ echo ""
7558ebc2
PP
2383$ echo "Your compiler may want other flags. For this question you should include"
2384$ echo "/INCLUDE=(whatever) and /DEFINE=(whatever), flags and any other flags"
2385$ echo "or qualifiers used by the compiler."
2386$ echo ""
2387$ echo "To use no flags, specify the word ""none""."
498336ed 2388$ dflt = user_c_flags
7558ebc2
PP
2389$ rp = "Any additional cc flags? [''dflt'] "
2390$ GOSUB myread
2391$ IF ans .EQS. "" THEN ans = "''dflt'"
2392$ IF ans .EQS. "none" THEN ans = ""
498336ed 2393$ user_c_flags = "''ans'"
97abc6ad 2394$!
cc391245
CB
2395$! Ask whether they want to use secure logical translation when tainting
2396$ echo ""
2397$ echo "As Perl starts up, it checks several logical names, such as"
2398$ echo "PERL5LIB and PERL_ENV_TABLES, which allow you to modify aspects"
2399$ echo "of its behavior. For additional security, you may limit this"
2400$ echo "process to executive- and kernel-mode translation when tainting"
2401$ echo "is enabled. In this case, logical names normally skipped when"
2402$ echo "tainting is enabled (e.g. PERL5OPTS) are translated as well."
2403$ echo "If you do not choose to do this, the usual order of access modes"
2404$ echo "is used for logical name translation."
2405$ echo ""
2406$ echo "This restriction does not apply to the %ENV hash or to implicit"
2407$ echo "logical name translation during parsing of file specifications;"
2408$ echo "these always use the normal sequence of access modes for logical"
2409$ echo "name translation."
01792a70 2410$ dflt = "y"
cc391245
CB
2411$ rp = "Use secure logical name translation? [''dflt'] "
2412$ GOSUB myread
570bb66e
JH
2413$ IF ans .eqs. "" THEN ans = dflt
2414$ IF ans
2415$ THEN d_secintgenv := Y
2416$ ELSE d_secintgenv := N
2417$ ENDIF
cc391245
CB
2418$!
2419$! Ask whether they want to default filetypes
2420$ echo ""
2421$ echo "When you pass the name of a program to Perl on the command line,"
2422$ echo "it generally doesn't supply any defaults unless the -S command"
2423$ echo "line switch is specified. In keeping with the VMS tradition of"
2424$ echo "default file types, however, you can configure Perl to try default"
2425$ echo "file types of nothing, .pl, and .com, in that order (e.g. typing"
2426$ echo """$ perl foo"" would cause Perl to look for foo., then foo.pl, and"
2427$ echo "finally foo.com)."
8c99d73e 2428$ echo ""
7558ebc2
PP
2429$ echo "This is currently broken in some configurations. Only enable it if"
2430$ echo "you know what you are doing."
570bb66e 2431$ dflt = "n"
cc391245
CB
2432$ rp = "Always use default file types? [''dflt'] "
2433$ GOSUB myread
570bb66e
JH
2434$ IF ans .EQS. "" THEN ans = dflt
2435$ IF ans
2436$ THEN d_alwdeftype := Y
2437$ ELSE d_alwdeftype := N
2438$ ENDIF
97abc6ad
HM
2439$! Ask if they want to use perl's memory allocator
2440$ echo ""
7558ebc2
PP
2441$ echo "Perl has a built-in memory allocator that is tuned for normal"
2442$ echo "memory usage. It is oftentimes better than the standard system"
2443$ echo "memory allocator. It also has the advantage of providing memory"
2444$ echo "allocation statistics, if you choose to enable them."
e6df7ed1 2445$ dflt = "n"
7558ebc2
PP
2446$ IF F$TYPE(usemymalloc) .EQS. "STRING"
2447$ THEN
2448$ IF usemymalloc THEN dflt = "y"
2449$ ENDIF
2450$ rp = "Do you wish to attempt to use the malloc that comes with ''package'? [''dflt'] "
97abc6ad 2451$ GOSUB myread
570bb66e
JH
2452$ IF ans .eqs. "" THEN ans = dflt
2453$ IF ans
2454$ THEN mymalloc := Y
2455$ ELSE mymalloc := N
2456$ ENDIF
2457$ IF mymalloc
429a5e67 2458$ THEN
570bb66e 2459$ IF use_debugging_perl
429a5e67
DS
2460$ THEN
2461$ echo ""
7558ebc2
PP
2462$ echo "Perl can keep statistics on memory usage if you choose to use"
2463$ echo "them. This is useful for debugging, but does have some"
2464$ echo "performance overhead."
e6df7ed1 2465$ dflt = "n"
429a5e67
DS
2466$ rp = "Do you want the debugging memory allocator? [''dflt'] "
2467$ gosub myread
7558ebc2 2468$ IF ans .eqs. "" THEN ans = "''dflt'"
146174a9 2469$ use_debugmalloc = f$extract(0, 1, f$edit(ans, "COLLAPSE,UPCASE"))
429a5e67
DS
2470$ ENDIF
2471$ ! Check which memory allocator we want
2472$ echo ""
7558ebc2
PP
2473$ echo "There are currently three different memory allocators: the"
2474$ echo "default (which is a pretty good general-purpose memory manager),"
2475$ echo "the TWO_POT allocator (which is optimized to save memory for"
2476$ echo "larger allocations), and PACK_MALLOC (which is optimized to save"
2477$ echo "memory for smaller allocations). They're all good, but if your"
2478$ echo "usage tends towards larger chunks use TWO_POT, otherwise use"
429a5e67 2479$ echo "PACK_MALLOC."
429a5e67
DS
2480$ dflt = "DEFAULT"
2481$ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2482$ GOSUB myread
2483$ if ans.eqs."" then ans = "''dflt'"
2484$ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2485$ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2486$ ENDIF
97abc6ad 2487$!
a3bd614a
PP
2488$ known_extensions = ""
2489$ xxx = ""
2490$ OPEN/READ CONFIG 'manifestfound'
2491$ext_loop:
2492$ READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
2493$ IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
2494 F$EXTRACT(0,8,line) .NES. "vms/ext/" THEN goto ext_loop
2495$ line = F$EDIT(line,"COMPRESS")
2496$ line = F$ELEMENT(0," ",line)
2497$ line_len = F$LENGTH(line)
2498$ IF F$EXTRACT(line_len - 12,12,line) .NES. "/Makefile.PL" THEN goto ext_loop
2499$ IF F$EXTRACT(0,4,line) .EQS. "ext/" THEN -
2500 xxx = F$EXTRACT(4,line_len - 16,line)
2501$ IF xxx .EQS. "DynaLoader" THEN goto ext_loop ! omit
2502$ IF xxx .EQS. "SDBM_File/sdbm" THEN goto ext_loop ! sub extension - omit
2503$ IF F$EXTRACT(0,8,line) .EQS. "vms/ext/" THEN -
2504 xxx = "VMS/" + F$EXTRACT(8,line_len - 20,line)
2505$ known_extensions = known_extensions + " ''xxx'"
2506$ goto ext_loop
2507$end_ext:
2508$ close CONFIG
2509$ DELETE/SYMBOL xxx
2510$ known_extensions = F$EDIT(known_extensions,"TRIM,COMPRESS")
2511$ dflt = known_extensions
2512$ IF ccname .NES. "DEC" .AND. ccname .NES. "CXX"
2513$ THEN
2514$ dflt = dflt - "POSIX" ! not with VAX C or GCC
2515$ ENDIF
2516$ dflt = dflt - "ByteLoader" ! needs to be ported
2517$ dflt = dflt - "DB_File" ! needs to be ported
2518$ dflt = dflt - "GDBM_File" ! needs porting/special library
2519$ dflt = dflt - "IPC/SysV" ! needs to be ported
2520$ dflt = dflt - "NDBM_File" ! needs porting/special library
2521$ dflt = dflt - "ODBM_File" ! needs porting/special library
dab31494 2522$ dflt = dflt - "Sys/Syslog" ! needs porting/special library "GDBM_File macro LOG_DEBUG"
9b5878df
CB
2523$ IF .NOT. Has_socketshr .AND. .NOT. Has_Dec_C_Sockets
2524$ THEN
2525$ dflt = dflt - "Socket" ! optional on VMS
2526$ ENDIF
386217e7
CB
2527$ IF .NOT. use_ithreads
2528$ THEN
2529$ dflt = dflt - "threads/shared"
2530$ dflt = dflt - "threads"
2531$ ENDIF
a3bd614a
PP
2532$ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2533$!
97abc6ad
HM
2534$! Ask for their default list of extensions to build
2535$ echo ""
7558ebc2
PP
2536$ echo "It is time to specify which modules you want to build into"
2537$ echo "perl. Most of these are standard and should be chosen, though"
2538$ echo "you might, for example, want to build GDBM_File instead of"
2539$ echo "SDBM_File if you have the GDBM library built on your machine."
2540$ echo ""
97abc6ad 2541$ echo "Which modules do you want to build into perl?"
97abc6ad
HM
2542$ rp = "[''dflt'] "
2543$ GOSUB myread
a3bd614a
PP
2544$ if ans .eqs. "" then ans = "''dflt'"
2545$ extensions = F$EDIT(ans,"TRIM,COMPRESS")
97abc6ad
HM
2546$!
2547$! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2548$ echo ""
570bb66e 2549$ echo "Checking your ""make"" utilities..."
97abc6ad
HM
2550$! If the 'build' that you use is not here add it and it's test
2551$! switch to the _END_ of these strings (and increment max_build)
2552$! (e.g. builders = builders + "/FOOMAKE"
2553$! probers = probers + " -fooVersionSwitch"
2554$! ) & please let me know about it.
2555$ builders = "IMAKE/GNUMAKE/MGMAKE/GMAKE/MAKE/MMS/MMK"
2556$ probers = "-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!-f Makefile. -v!/IDENT!/IDENT"
2557$ max_build = 7
2558$!
2559$ orig_dflt = "MMK"
2560$ default_set = ""
2561$ ok_builders = ""
2562$ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2563$ WRITE CONFIG "dont_make_anything_yet:"
2564$ WRITE CONFIG F$FAO("!_")
2565$ CLOSE CONFIG
2566$ n = 0
2567$ messages = F$ENVIRONMENT("MESSAGE")
2568$Build_probe:
2569$ build = F$ELEMENT(n,"/",builders)
2570$ probe = F$ELEMENT(n,"!",probers)
2571$ echo "Testing whether you have ''build' on your system..."
570bb66e
JH
2572$!
2573$! Noted with GNU Make version 3.60 that the $status and $severity
2574$! with the 'probe' Makefile appear to be: $STATUS == "%X1000000C"
2575$! $SEVERITY == "4".
2576$!
a3ef2c6f
GS
2577$ SET NOON
2578$ ON CONTROL_Y THEN GOTO Reenable_messages_build
2579$ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
97abc6ad 2580$ 'build' 'probe'
570bb66e 2581$ IF ($SEVERITY .EQ. 1) ! not adequate?
97abc6ad
HM
2582$ THEN
2583$ echo "OK."
2584$ IF (build .EQS. orig_dflt)
2585$ THEN
2586$ default_set = "TRUE"
2587$ dflt = build
2588$ ENDIF
2589$ ok_builders = ok_builders + " " + build
2590$ IF (.NOT. default_set) THEN dflt = build
2591$ ELSE
2592$ echo "Nope."
2593$ ENDIF
a3ef2c6f
GS
2594$Reenable_messages_build:
2595$ SET MESSAGE 'messages'
2596$ SET ON
97abc6ad
HM
2597$ n = n + 1
2598$ IF (n .LT. max_build) THEN GOTO Build_probe
2599$!
2600$ echo ""
2601$ IF (ok_builders .NES. "")
2602$ THEN
2603$ echo "Here is the list of builders you can apparently use:"
2604$ echo "(",ok_builders," )"
a5fddd44 2605$ rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
97abc6ad
HM
2606$ GOSUB myread
2607$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2608$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2609$ IF (ans .EQS. "")
2610$ THEN build = dflt
2611$ ELSE build = ans
2612$ ENDIF
2613$ ELSE
2614$ TYPE SYS$INPUT:
7558ebc2 2615$ DECK
97abc6ad
HM
2616
2617%Config-E-VMS, ERROR:
2618 Well this looks pretty serious. Perl5 cannot be compiled without a "make"
2619 utility of some sort and after checking my "builders" list I cannot find
2620 the symbol or command you use on your system to compile programs.
2621
7558ebc2 2622$ EOD
570bb66e 2623$ READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
97abc6ad
HM
2624$ ans = F$EDIT(ans,"TRIM, COMPRESS")
2625$ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
2626$ IF (ans .EQS. "")
2627$ THEN build = dflt
7558ebc2 2628$ echo "I do not know where ""make"" is, and my life depends on it."
97abc6ad
HM
2629$ echo "Go find a make program or fix your DCL$PATH setting!"
2630$ echo "ABORTING..."
2631$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
2632$ STOP
2633$ EXIT 2 !$STATUS = "%X00000002" (error)
2634$ ELSE
2635$ build = ans
2636$ ENDIF
2637$ ENDIF
2638$!
2639$ DELETE/NOLOG Makefile.;
2640$ GOTO Beyond_open
2641$Open_error:
2642$ TYPE SYS$INPUT:
7558ebc2 2643$ DECK
97abc6ad
HM
2644
2645 There seems to be trouble. I just tried to create a file in
7558ebc2 2646$ EOD
97abc6ad
HM
2647$ echo4 'F$ENVIRONMENT("DEFAULT")'
2648$ TYPE SYS$INPUT:
7558ebc2 2649$ DECK
97abc6ad
HM
2650 but was unsuccessful. I am stopping now. Please check that directories'
2651 PROTECTION bits. I will leave you in the directory where you started
2652 Configure.com
7558ebc2 2653$ EOD
97abc6ad
HM
2654$ echo4 "ABORTING..."
2655$ GOTO Clean_up
2656$ STOP
2657$ EXIT
2658$!
2659$Beyond_open:
2660$! echo " Very well I will proceed with ""''build'"""
2661$ make = F$EDIT(build,"UPCASE")
2662$!
2663$!: locate the preferred pager for this system
2664$!pagers = "most|more|less|type/page"
dfe814dc
PP
2665$ dflt = "type/page"
2666$! assume that the presence of a most symbol indicates the presence
2667$! of the pager.
2668$ IF F$TYPE(most) .EQS. "STRING" THEN dflt = "most"
2669$ IF F$TYPE(pager) .EQS. "STRING" THEN dflt = pager
2670$ rp="What pager is used on your system? [''dflt'] "
2671$ GOSUB myread
2672$ IF (ans .EQS. "")
2673$ THEN pager = dflt
2674$ ELSE pager = ans
2675$ ENDIF
97abc6ad
HM
2676$!
2677$! update [.vms]config.vms here
2678$!
2679$! update makefile here
2680$! echo4 "Updating makefile..."
2681$!
2682$ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
2683$ THEN
08c7cbbb
GS
2684$ makefile = "" !wrt MANIFEST dir
2685$ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
2686$ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
570bb66e 2687$ Makefile_SH = "descrip_mms.template"
97abc6ad 2688$ ELSE
08c7cbbb
GS
2689$ makefile = " -f Makefile." !wrt MANIFEST dir
2690$ UUmakefile = "[-]Makefile." !wrt CWD dir
2691$ DEFmakefile = "Makefile." !wrt DEF dir (?)
570bb66e 2692$ Makefile_SH = "Makefile.in"
97abc6ad
HM
2693$ ENDIF
2694$!
7558ebc2
PP
2695$ IF macros .NES. ""
2696$ THEN
97abc6ad
HM
2697$ tmp = F$LENGTH(macros)
2698$ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
2699$ macros = "/macro=(" + macros + ")"
2700$ ENDIF
498336ed
CB
2701$! Build up the extra C flags
2702$!
7558ebc2
PP
2703$ IF use_ieee_math
2704$ THEN
498336ed 2705$ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm_results"
7558ebc2
PP
2706$ ENDIF
2707$ IF be_case_sensitive
2708$ THEN
498336ed 2709$ extra_flags = "''extra_flags'" + "/Names=As_Is"
7558ebc2 2710$ ENDIF
498336ed 2711$ extra_flags = "''extra_flags'" + "''user_c_flags'"
97abc6ad 2712$!
570bb66e
JH
2713$ min_pgflquota = "100000"
2714$ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
2715$ IF pgflquota .LES. min_pgflquota
2716$ THEN
2717$ echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
2718$ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
2719$ IF ans
2720$ THEN
2721$ echo4 "Continuing..."
2722$ ELSE
2723$ echo4 "ABORTING..."
2724$ GOTO Clean_up
2725$ ENDIF
2726$ ENDIF
97abc6ad 2727$!
c998f3c7
PP
2728$! PerlIO abstraction
2729$!
5d8a6eb9 2730$ dflt = "y"
c998f3c7
PP
2731$ IF F$TYPE(useperlio) .NES. ""
2732$ THEN
5d8a6eb9 2733$ IF useperlio .EQS. "undef" THEN dflt = "n"
c998f3c7
PP
2734$ ENDIF
2735$ IF .NOT. silent
2736$ THEN
5d8a6eb9 2737$ echo "Previous versions of ''package' used the standard IO mechanisms as"
c998f3c7
PP
2738$ TYPE SYS$INPUT:
2739$ DECK
2740defined in <stdio.h>. Versions 5.003_02 and later of perl allow
2741alternate IO mechanisms via the PerlIO abstraction layer, but the
5d8a6eb9
CB
2742stdio mechanism is still available if needed. The abstraction layer
2743can use AT&T's sfio (if you already have sfio installed) or regular stdio.
c998f3c7
PP
2744Using PerlIO with sfio may cause problems with some extension modules.
2745
2746$ EOD
2747$ echo "If this does not make any sense to you, just accept the default '" + dflt + "'."
2748$ ENDIF
5d8a6eb9 2749$ rp = "Use the PerlIO abstraction layer? [''dflt'] "
c998f3c7
PP
2750$ GOSUB myread
2751$ IF ans .EQS. "" THEN ans = dflt
2752$ IF ans
2753$ THEN
2754$ useperlio = "define"
2755$ ELSE
2756$ echo "Ok, doing things the stdio way."
2757$ useperlio = "undef"
2758$ ENDIF
2759$!
97abc6ad 2760$ echo ""
570bb66e
JH
2761$ echo4 "Checking the C run-time library."
2762$!
56aeb0ae 2763$! Former SUBCONFIGURE.COM
570bb66e
JH
2764$!
2765$! - build a config.sh for VMS Perl.
2766$! - use built config.sh to take config_h.SH -> config.h
2767$! - also take vms/descrip_mms.template -> descrip.mms (VMS Makefile)
2768$! vms/Makefile.in -> Makefile. (VMS GNU Makefile?)
2769$! vms/Makefile.SH -> Makefile. (VMS GNU Makefile?)
570bb66e
JH
2770$!
2771$! Note for folks from other platforms changing things in here:
2772$!
2773$! Fancy changes (based on compiler capabilities or VMS version or
2774$! whatever) are tricky, so go ahead and punt on those.
2775$!
2776$! Simple changes, though (say, always setting something to 1, or undef,
2777$! or something like that) are straightforward. Adding a new constant
2778$! item for the ultimately created config.sh requires at least one
2779$! (possibly more) line(s) to this file.
2780$!
2781$! Add a line in the format:
2782$!
2783$! $ WC "foo='undef'"
2784$!
2785$! somewhere between the line tagged '##BEGIN WRITE NEW CONSTANTS HERE##'
2786$! and the one tagged '##END WRITE NEW CONSTANTS HERE##' (note the order
2787$! is sorted ASCII and corresponds to the output of config.sh in the
2788$! Bourne shell version of Configure).
2789$! Be very careful with quoting, as it can be tricky.
2790$! For example if instead of a constant string like 'undef' or 'define'
2791$! you wanted to add something to VMS's config.sh that looks like:
2792$!
2793$! blank_string=''
2794$!
2795$! then add a line that looks like this before the
2796$! '##END WRITE NEW CONSTANTS HERE##' tagged line:
2797$!
2798$! $ WC "blank_string='" + "'"
2799$!
2800$! (+ is the string concatenator and "''var'" has the effect
2801$! of "${var}" in perl or sh, but "'const'" is not interpolated).
2802$!
2803$! Note that unitialized variables, such as a line like:
2804$!
2805$! $ WC "new_var='" + new_var + "'"
2806$!
2807$! should be avoided unless new_var has a value assigned prior
2808$! to that line (think of perl's -w warnings).
2809$!
2810$! %DCL-W-UNDSYM, undefined symbol - check validity and spelling
2811$! \NEW_VAR\
2812$!
2813$!
2814$ vms_ver = F$EXTRACT(1,3, osvers)
2815$ IF F$LENGTH(Mcc) .EQ. 0 THEN Mcc := "cc"
2816$ MCC = f$edit(mcc, "UPCASE")
2817$ C_Compiler_Replace := "CC=CC=''Mcc'''ccflags'"
414b89cc 2818$ IF ccname .EQS. "DEC"
570bb66e
JH
2819$ THEN
2820$ Checkcc := "''Mcc'/prefix=all"
2821$ ELSE
414b89cc 2822$ IF ccname .EQS. "CXX"
570bb66e
JH
2823$ THEN
2824$ Checkcc := cxx
2825$ ELSE
2826$ Checkcc := "''Mcc'"
2827$ ENDIF
2828$ ENDIF
2829$ ccflags = ccflags + extra_flags
2830$ IF be_case_sensitive
2831$ THEN
2832$ d_vms_be_case_sensitive = "define"
2833$ ELSE
2834$ d_vms_be_case_sensitive = "undef"
2835$ ENDIF
2836$! Some constant defaults.
2837$ hwname = f$getsyi("HW_NAME")
2838$ myname = myhostname
2839$ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
2840$!
2841$ ccdlflags=""
2842$ cccdlflags=""
2843$!
2844$ IF use64bitint .OR. use64bitint .EQS. "define"
2845$ THEN
2846$ use64bitint = "define"
2847$ uselargefiles = "define"
2848$ uselongdouble = "define"
414b89cc 2849$ alignbytes="16"
570bb66e 2850$ usemorebits = "define"
842bcadf
CB
2851$ ivdformat="""Ld"""
2852$ uvuformat="""Lu"""
2853$ uvoformat="""Lo"""
2854$ uvxformat="""Lx"""
2855$ uvXUformat="""LX"""
570bb66e
JH
2856$ ELSE
2857$ use64bitint = "undef"
2858$ uselargefiles = "undef"
2859$ uselongdouble = "undef"
2860$ usemorebits = "undef"
842bcadf
CB
2861$ ivdformat="""ld"""
2862$ uvuformat="""lu"""
2863$ uvoformat="""lo"""
2864$ uvxformat="""lx"""
2865$ uvXUformat="""lX"""
2866$ ENDIF
2867$ IF uselongdouble .OR. uselongdouble .EQS. "define"
2868$ THEN
2869$ nveformat="""Le"""
2870$ nvfformat="""Lf"""
2871$ nvgformat="""Lg"""
2872$ ELSE
2873$ nveformat="""e"""
2874$ nvfformat="""f"""
2875$ nvgformat="""g"""
570bb66e
JH
2876$ ENDIF
2877$ IF use64bitall .OR. use64bitall .EQS. "define"
2878$ THEN
2879$ use64bitall = "define"
2880$ ELSE
2881$ use64bitall = "undef"
2882$ ENDIF
2883$!
2884$ usemymalloc=mymalloc
2885$!
2886$ perl_cc=Mcc
2887$!
55315086 2888$ IF (sharedperl .AND. archname .EQS. "VMS_AXP")
570bb66e
JH
2889$ THEN
2890$ obj_ext=".abj"
2891$ so="axe"
2892$ dlext="axe"
2893$ exe_ext=".axe"
2894$ lib_ext=".alb"
2895$ ELSE
2896$ obj_ext=".obj"
2897$ so="exe"
2898$ dlext="exe"
2899$ exe_ext=".exe"
2900$ lib_ext=".olb"
2901$ ENDIF
2902$ dlobj="dl_vms''obj_ext'"
2903$!
2904$ cppstdin="''perl_cc'/noobj/preprocess=sys$output sys$input"
2905$ cppminus=" "
2906$ cpprun="''perl_cc'/noobj/preprocess=sys$output sys$input"
2907$ cpplast=" "
2908$!
2909$ timetype="time_t"
2910$ signal_t="void"
2911$ stdchar="char"
2912$!
2913$ IF mymalloc
2914$ THEN d_mymalloc="define"
2915$ ELSE d_mymalloc="undef"
2916$ ENDIF
2917$!
2918$ usedl="define"
ef060a86 2919$ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
4a5365b8 2920$ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
570bb66e
JH
2921$!
2922$ IF ((Use_Threads) .AND. (vms_ver .LES. "6.2"))
2923$ THEN
2924$ 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"
2925$ ELSE
2926$ libs=" "
2927$ ENDIF
414b89cc 2928$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
570bb66e
JH
2929$ THEN
2930$ libc="(DECCRTL)"
2931$ ELSE
2932$ libc=" "
2933$ ENDIF
2934$!
94928b12
JH
2935$! perllibs should be libs with all non-core libs (such as gdbm) removed.
2936$!
2937$ perllibs=libs
2938$!
570bb66e
JH
2939$! Are we 64 bit?
2940$!
2941$ IF use64bitint .OR. use64bitint .EQS. "define"
2942$ THEN
2943$ d_PRId64 = "define"
6b356c8e
JH
2944$ d_PRIEUldbl = "define"
2945$ d_PRIFUldbl = "define"
2946$ d_PRIGUldbl = "define"
59a27e12 2947$ d_PRIeldbl = "define"
570bb66e
JH
2948$ d_PRIfldbl = "define"
2949$ d_PRIgldbl = "define"
2950$ d_PRIu64 = "define"
2951$ d_PRIo64 = "define"
2952$ d_PRIx64 = "define"
842bcadf 2953$ d_PRIXU64 = "define"
570bb66e 2954$ sPRId64 = """Ld"""
6b356c8e
JH
2955$ sPRIEUldbl = """LE"""
2956$ sPRIFUldbl = """LF"""
2957$ sPRIGUldbl = """LG"""
2958$ sPRIXU64 = """LX"""
59a27e12 2959$ sPRIeldbl = """Le"""
570bb66e
JH
2960$ sPRIfldbl = """Lf"""
2961$ sPRIgldbl = """Lg"""
59a27e12 2962$ sPRIi64 = """Li"""
570bb66e
JH
2963$ sPRIo64 = """Lo"""
2964$ sPRIu64 = """Lu"""
2965$ sPRIx64 = """Lx"""
2966$ d_quad = "define"
2967$ quadtype = "long long"
2968$ uquadtype = "unsigned long long"
2969$ quadkind = "QUAD_IS_LONG_LONG"
2970$ d_frexpl = "define"
dfe814dc 2971$ d_isnan = "define"
570bb66e
JH
2972$ d_isnanl = "define"
2973$ d_modfl = "define"
2974$ ELSE
2975$ d_PRId64 = "undef"
6b356c8e
JH
2976$ d_PRIEUldbl = "define"
2977$ d_PRIFUldbl = "define"
2978$ d_PRIGUldbl = "define"
2979$ d_PRIXU64 = "undef"
59a27e12 2980$ d_PRIeldbl = "define"
570bb66e
JH
2981$ d_PRIfldbl = "undef"
2982$ d_PRIgldbl = "undef"
2983$ d_PRIu64 = "undef"
2984$ d_PRIo64 = "undef"
2985$ d_PRIx64 = "undef"
2986$ sPRId64 = ""
6b356c8e
JH
2987$ sPRIEUldbl = """E"""
2988$ sPRIFUldbl = """F"""
2989$ sPRIGUldbl = """G"""
2990$ sPRIXU64 = """lX"""
59a27e12
PP
2991$ sPRIeldbl = """e"""
2992$ sPRIfldbl = """f"""
2993$ sPRIgldbl = """g"""
2994$ sPRIi64 = ""
570bb66e
JH
2995$ sPRIo64 = ""
2996$ sPRIu64 = ""
2997$ sPRIx64 = ""
2998$ d_quad = "undef"
2999$ quadtype = "long"
3000$ uquadtype = "unsigned long"
3001$ quadkind = "QUAD_IS_LONG"
3002$ d_frexpl = "undef"
dfe814dc 3003$ d_isnan = "undef"
570bb66e
JH
3004$ d_isnanl = "undef"
3005$ d_modfl = "undef"
3006$ ENDIF
b5ddfb46
PP
3007$ d_SCNfldbl = d_PRIfldbl
3008$ sSCNfldbl = sPRIfldbl ! expect consistency
570bb66e
JH
3009$!
3010$! Now some that we build up
3011$!
3012$ IF Use_Threads
3013$ THEN
3014$ IF use_5005_threads
3015$ THEN
3016$ arch = "''arch'-thread"
3017$ archname = "''archname'-thread"
3018$ d_old_pthread_create_joinable = "undef"
3019$ old_pthread_create_joinable = " "
3020$ use5005threads = "define"
3021$ useithreads = "undef"
3022$ ELSE
3023$ arch = "''arch'-ithread"
3024$ archname = "''archname'-ithread"
3025$ d_old_pthread_create_joinable = "undef"
3026$ old_pthread_create_joinable = " "
3027$ use5005threads = "undef"
3028$ useithreads = "define"
3029$ ENDIF
3030$ ELSE
3031$ d_old_pthread_create_joinable = "undef"
3032$ old_pthread_create_joinable = " "
3033$ use5005threads = "undef"
3034$ useithreads = "undef"
3035$ ENDIF
3036$!
3037$! Some that we need to invoke the compiler for
3038$!
3039$!
3040$! handy construction aliases/symbols
3041$!
3042$ OS := "open/write CONFIG []try.c"
3043$ WS := "write CONFIG"
3044$ CS := "close CONFIG"
3045$ DS := "delete/nolog/noconfirm []try.*;*"
3046$ Needs_Opt := N
3047$ good_compile = %X10B90001
414b89cc 3048$ IF ccname .EQS. "GCC"
570bb66e
JH
3049$ THEN
3050$ open/write OPTCHAN []try.opt
3051$ write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3052$ write OPTCHAN "Sys$Share:VAXCRTL/Share"
3053$ Close OPTCHAN
3054$ Needs_Opt := Y
3055$ good_compile = %X10000001
3056$ ENDIF
414b89cc 3057$ IF ccname .EQS. "CXX"
570bb66e
JH
3058$ THEN
3059$ good_compile = %X15F60001
3060$ ENDIF
3061$ good_link = %X10000001
3062$ tmp = "" ! null string default
3063$!
3064$ GOTO beyond_compile_ok
3065$!
3066$! Check for type sizes
3067$!
3068$type_size_check:
3069$!
3070$ OS
7558ebc2
PP
3071$ WS "#if defined(__DECC) || defined(__DECCXX)"
3072$ WS "#include <stdlib.h>"
3073$ WS "#endif"
3074$ WS "#include <stdio.h>"
3075$ WS "int main()"
570bb66e
JH
3076$ WS "{"
3077$ WS "printf(""%d\n"", sizeof(''tmp'));"
7558ebc2 3078$ WS "exit(0);"
570bb66e
JH
3079$ WS "}"
3080$ CS
3081$ GOSUB compile
3082$ RETURN
3083$!
3084$!: locate header file
3085$findhdr:
3086$!
3087$ OS
7558ebc2
PP
3088$ WS "#if defined(__DECC) || defined(__DECCXX)"
3089$ WS "#include <stdlib.h>"
3090$ WS "#endif"
3091$ WS "#include <stdio.h>"
570bb66e 3092$ WS "#include <''tmp'>"
7558ebc2 3093$ WS "int main()"
570bb66e
JH
3094$ WS "{"
3095$ WS "printf(""define\n"");"
7558ebc2 3096$ WS "exit(0);"
570bb66e
JH
3097$ WS "}"
3098$ CS
3099$ GOSUB link_ok
3100$ RETURN
3101$!
3102$!: define an alternate in-header-list? function
3103$inhdr:
3104$!
3105$ GOSUB findhdr
3106$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3107$ THEN
3108$ echo4 "<''tmp'> found."
3109$ tmp = "define"
3110$ ELSE
3111$ echo4 "<''tmp'> NOT found."
3112$ tmp = "undef"
3113$ ENDIF
3114$ RETURN
3115$!
3116$!: define an is-in-libc? function
3117$inlibc:
3118$ GOSUB link_ok
3119$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3120$ THEN
3121$ echo4 "''tmp'() found."
3122$ tmp = "define"
3123$ ELSE
3124$ echo4 "''tmp'() NOT found."
3125$ tmp = "undef"
3126$ ENDIF
3127$ RETURN
3128$!
3129$!: define a shorthand compile call
3130$compile:
3131$ GOSUB link_ok
3132$just_mcr_it:
3133$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3134$ THEN
3135$ OPEN/WRITE CONFIG []try.out
3136$ DEFINE/USER_MODE SYS$ERROR CONFIG
3137$ DEFINE/USER_MODE SYS$OUTPUT CONFIG
3138$ MCR []try.exe
3139$ CLOSE CONFIG
3140$ OPEN/READ CONFIG []try.out
3141$ READ CONFIG tmp
3142$ CLOSE CONFIG
3143$ DELETE/NOLOG/NOCONFIRM []try.out;
3144$ DELETE/NOLOG/NOCONFIRM []try.exe;
3145$ ELSE
3146$ tmp = "" ! null string default
3147$ ENDIF
3148$ RETURN
3149$!
3150$link_ok:
3151$ GOSUB compile_ok
3152$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3153$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3154$ SET NOON
3155$ IF Needs_Opt
3156$ THEN
3157$ 'ld' try.obj,try.opt/opt
3158$ link_status = $status
3159$ ELSE
3160$ 'ld' try.obj
3161$ link_status = $status
3162$ ENDIF
3163$ SET ON
3164$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3165$ RETURN
3166$!
3167$!: define a shorthand compile call for compilations that should be ok.
3168$compile_ok:
3169$ DEFINE/USER_MODE SYS$ERROR _NLA0:
3170$ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3171$ SET NOON
3172$ 'Checkcc' try.c
3173$ compile_status = $status
3174$ SET ON
3175$ DELETE/NOLOG/NOCONFIRM try.c;
3176$ RETURN
3177$!
3178$beyond_compile_ok:
3179$!
3180$! Check for __STDC__
3181$!
3182$ OS
7558ebc2
PP
3183$ WS "#if defined(__DECC) || defined(__DECCXX)"
3184$ WS "#include <stdlib.h>"
3185$ WS "#endif"
3186$ WS "#include <stdio.h>"
3187$ WS "int main()"
570bb66e 3188$ WS "{"
7558ebc2
PP
3189$ WS "#ifdef __STDC__"
3190$ WS "printf(""42\n"");"
3191$ WS "#else"
3192$ WS "printf(""1\n"");"
3193$ WS "#endif"
3194$ WS "exit(0);"
570bb66e
JH
3195$ WS "}"
3196$ CS
3197$ GOSUB compile
3198$ cpp_stuff=tmp
3199$ IF F$INTEGER(tmp) .eq. 42
3200$ THEN
3201$ echo4 "Your C compiler and pre-processor defines the symbol:"
3202$ echo4 "__STDC__"
3203$ ENDIF
3204$!
3205$! Check for double size
3206$!
3207$ echo4 "Checking to see how big your double precision numbers are..."
3208$ tmp="double"
3209$ GOSUB type_size_check
3210$ doublesize = tmp
3211$ echo "Your double is ''doublesize' bytes long."
3212$!
3213$! Check for long double size
3214$!
3215$ OS
7558ebc2
PP
3216$ WS "#if defined(__DECC) || defined(__DECCXX)"
3217$ WS "#include <stdlib.h>"
3218$ WS "#endif"
3219$ WS "#include <stdio.h>"
3220$ WS "int main()"
570bb66e 3221$ WS "{"
7558ebc2
PP
3222$ WS "printf(""%d\n"", sizeof(long double));"
3223$ WS "exit(0);"
570bb66e
JH
3224$ WS "}"
3225$ CS
3226$ echo4 "Checking to see if you have long double..."
3227$ GOSUB link_ok
3228$ IF link_status .NE. good_link
3229$ THEN
3230$ longdblsize="0"
3231$ d_longdbl="undef"
3232$ echo "You do not have long double."
3233$ ELSE
3234$ echo "You have long double."
3235$ echo4 "Checking to see how big your long doubles are..."
3236$ GOSUB just_mcr_it
3237$ longdblsize = tmp
3238$ d_longdbl = "define"
3239$ echo "Your long doubles are ''longdblsize' bytes long."
3240$ ENDIF
3241$!
3242$!: check for long long
3243$ OS
7558ebc2
PP
3244$ WS "#if defined(__DECC) || defined(__DECCXX)"
3245$ WS "#include <stdlib.h>"
3246$ WS "#endif"
3247$ WS "#include <stdio.h>"
3248$ WS "int main()"
570bb66e 3249$ WS "{"
7558ebc2
PP
3250$ WS "printf(""%d\n"", sizeof(long long));"
3251$ WS "exit(0);"
570bb66e
JH
3252$ WS "}"
3253$ CS
3254$ echo4 "Checking to see if you have long long..."
3255$ GOSUB link_ok
3256$ IF link_status .NE. good_link
3257$ THEN
3258$ longlongsize="0"
3259$ d_longlong="undef"
3260$ echo "You do not have long long."
3261$ ELSE
3262$ echo "You have long long."
3263$ echo4 "Checking to see how big your long longs are..."
3264$ GOSUB just_mcr_it
3265$ longlongsize = tmp
3266$ d_longlong = "define"
3267$ echo "Your long longs are ''longlongsize' bytes long."
3268$ ENDIF
3269$!
3270$! Check the prototype for getgid
3271$!
3272$ echo "Looking for the type for group ids returned by getgid()."
3273$ OS
7558ebc2
PP
3274$ WS "#if defined(__DECC) || defined(__DECCXX)"
3275$ WS "#include <stdlib.h>"
3276$ WS "#endif"
3277$ WS "#include <stdio.h>"
3278$ WS "#include <types.h>"
3279$ WS "int main()"
570bb66e 3280$ WS "{"
7558ebc2
PP
3281$ WS "gid_t foo;"
3282$ WS "exit(0);"
570bb66e
JH
3283$ WS "}"
3284$ CS
3285$ GOSUB compile_ok
3286$ IF compile_status .NE. good_compile
3287$ THEN
3288$! Okay, gid_t failed. Must be unsigned int
3289$ gidtype = "unsigned int"
3290$ echo4 "assuming ""''gidtype'""."
3291$ ELSE
3292$ gidtype = "gid_t"
3293$ echo4 "gid_t found."
3294$ ENDIF
3295$!
3296$! Check to see if we've got dev_t
3297$!
3298$ echo "Looking for the type for dev."
3299$ OS
7558ebc2
PP
3300$ WS "#if defined(__DECC) || defined(__DECCXX)"
3301$ WS "#include <stdlib.h>"
3302$ WS "#endif"
3303$ WS "#include <stdio.h>"
3304$ WS "#include <types.h>"
3305$ WS "int main()"
570bb66e 3306$ WS "{"
7558ebc2
PP
3307$ WS "dev_t foo;"
3308$ WS "exit(0);"
570bb66e
JH
3309$ WS "}"
3310$ CS
3311$ GOSUB compile_ok
3312$ IF compile_status .NE. good_compile
3313$ THEN
3314$! Okay, dev_t failed. Must be unsigned int
3315$ devtype = "unsigned int"
3316$ echo4 "assuming ""''devtype'""."
3317$ ELSE
3318$ devtype = "dev_t"
3319$ echo4 "dev_t found."
3320$ ENDIF
3321$!
3322$! Check to see if we've got unistd.h (which we ought to, but you never know)
3323$!
3324$ i_netdb = "undef"
3325$ tmp = "unistd.h"
3326$ GOSUB inhdr
3327$ i_unistd = tmp
3328$!
3329$!: see if this is a libutil.h system
3330$!
3331$ tmp = "libutil.h"
3332$ GOSUB inhdr
3333$ i_libutil = tmp
3334$!
3335$! Check to see if we've got shadow.h (probably not, but...)
3336$!
3337$ tmp = "shadow.h"
3338$ GOSUB inhdr
3339$ i_shadow = tmp
3340$!
3341$! Check to see if we've got socks.h (probably not, but...)
3342$!
3343$ tmp = "socks.h"
3344$ GOSUB inhdr
3345$ i_socks = tmp
3346$!
3347$! Check the prototype for select
3348$!
3349$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3350$ THEN
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>"
3357$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
570bb66e
JH
3358$ IF Has_Socketshr
3359$ THEN
3360$ WS "#include <socketshr.h>"
3361$ ELSE
7558ebc2
PP
3362$ WS "#include <time.h>"
3363$ WS "#include <socket.h>"
570bb66e 3364$ ENDIF
7558ebc2 3365$ WS "int main()"
570bb66e 3366$ WS "{"
7558ebc2
PP
3367$ WS "fd_set *foo;"
3368$ WS "int bar;"
3369$ WS "foo = NULL;"
3370$ WS "bar = select(2, foo, foo, foo, NULL);"
3371$ WS "exit(0);"
570bb66e
JH
3372$ WS "}"
3373$ CS
3374$ GOSUB compile_ok
3375$ IF compile_status .NE. good_compile
3376$ THEN
3377$! Okay, select failed. Must be an int *
3378$ selecttype = "int *"
3379$ echo4 "select() NOT found."
3380$ ELSE
3381$ selecttype="fd_set *"
3382$ echo4 "select() found."
3383$ ENDIF
3384$ ELSE
3385$ ! No sockets, so stick in an int * : no select, so pick a harmless default
3386$ selecttype = "int *"
3387$ ENDIF
3388$!
3389$! Check to see if fd_set exists
3390$!
3391$ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3392$ OS
7558ebc2
PP
3393$ WS "#if defined(__DECC) || defined(__DECCXX)"
3394$ WS "#include <stdlib.h>"
3395$ WS "#endif"
3396$ WS "#include <stdio.h>"
3397$ WS "#include <types.h>"
570bb66e
JH
3398$ IF Has_Socketshr
3399$ THEN
3400$ WS "#include <socketshr.h>"
3401$ ENDIF
3402$ IF Has_Dec_C_Sockets
3403$ THEN
7558ebc2
PP
3404$ WS "#include <time.h>"
3405$ WS "#include <socket.h>"
570bb66e 3406$ ENDIF
7558ebc2 3407$ WS "int main()"
570bb66e 3408$ WS "{"
7558ebc2
PP
3409$ WS "fd_set *foo;"
3410$ WS "int bar;"
3411$ WS "exit(0);"
570bb66e
JH
3412$ WS "}"
3413$ CS
3414$ GOSUB compile_ok
3415$ IF compile_status .ne. good_compile
3416$ THEN
3417$! Okay, fd_set failed. Must not exist
3418$ d_fd_set = "undef"
3419$ echo4 "Hmm, your compiler has some difficulty with fd_set."
3420$ ELSE
3421$ d_fd_set="define"
3422$ echo4 "Well, your system knows about the normal fd_set typedef..."
3423$ ENDIF
3424$!
3425$! Check for inttypes.h
3426$!
3427$ tmp = "inttypes.h"
3428$ GOSUB inhdr
3429$ i_inttypes = tmp
3430$!
3431$! Check to see if off64_t exists
3432$!
3433$ echo4 "Checking to see if you have off64_t..."
3434$ OS
7558ebc2
PP
3435$ WS "#if defined(__DECC) || defined(__DECCXX)"
3436$ WS "#include <stdlib.h>"
3437$ WS "#endif"
3438$ WS "#include <stdio.h>"
3439$ WS "#include <types.h>"
3440$ WS "#''i_inttypes' IIH"
3441$ WS "#ifdef IIH"
3442$ WS "#include <inttypes.h>"
3443$ WS "#endif"
3444$ WS "int main()"
570bb66e 3445$ WS "{"
7558ebc2
PP
3446$ WS "off64_t bar;"
3447$ WS "exit(0);"
570bb66e
JH
3448$ WS "}"
3449$ CS
3450$ GOSUB compile_ok
3451$ IF compile_status .EQ. good_compile
3452$ THEN
3453$ d_off64_t="define"
3454$ echo "You have off64_t."
3455$ ELSE
3456$ d_off64_t = "undef"
3457$ echo "You do not have off64_t."
3458$ ENDIF
3459$!
3460$! Check to see if fpos64_t exists
3461$!
3462$ echo4 "Checking to see if you have fpos64_t..."
3463$ OS
7558ebc2
PP
3464$ WS "#if defined(__DECC) || defined(__DECCXX)"
3465$ WS "#include <stdlib.h>"
3466$ WS "#endif"
3467$ WS "#include <stdio.h>"
3468$ WS "#include <types.h>"
3469$ WS "#''i_inttypes' IIH"
3470$ WS "#ifdef IIH"
3471$ WS "#include <inttypes.h>"
3472$ WS "#endif"
3473$ WS "int main()"
570bb66e 3474$ WS "{"
7558ebc2
PP
3475$ WS "fpos64_t bar;"
3476$ WS "exit(0);"
570bb66e
JH
3477$ WS "}"
3478$ CS
3479$ GOSUB compile_ok
3480$ IF compile_status .EQ. good_compile
3481$ THEN
3482$ d_fpos64_t="define"
3483$ echo "You have fpos64_t."
3484$ ELSE
3485$ d_fpos64_t = "undef"
3486$ echo "You do not have fpos64_t."
3487$ ENDIF
3488$!
3489$! Check to see if int64_t exists
3490$!
3491$ echo4 "Checking to see if you have int64_t..."
3492$ OS
7558ebc2
PP
3493$ WS "#if defined(__DECC) || defined(__DECCXX)"
3494$ WS "#include <stdlib.h>"
3495$ WS "#endif"
3496$ WS "#include <stdio.h>"
3497$ WS "#include <types.h>"
3498$ WS "#''i_inttypes' IIH"
3499$ WS "#ifdef IIH"
3500$ WS "#include <inttypes.h>"
3501$ WS "#endif"
3502$ WS "int main()"
570bb66e 3503$ WS "{"
7558ebc2
PP
3504$ WS "int64_t bar;"
3505$ WS "exit(0);"
570bb66e
JH
3506$ WS "}"
3507$ CS
3508$ GOSUB compile_ok
3509$ IF compile_status .EQ. good_compile
3510$ THEN
3511$ d_int64_t="define"
3512$ echo "You have int64_t."
3513$ ELSE
3514$ d_int64_t = "undef"
3515$ echo "You do not have int64_t."
3516$ ENDIF
3517$!
3518$!: see if this is a netdb.h system
3519$ IF Has_Dec_C_Sockets
3520$ THEN
3521$ tmp = "netdb.h"
3522$ GOSUB inhdr
3523$ i_netdb = tmp
3524$ ENDIF
3525$!
3526$! Check for h_errno
3527$!
3528$ echo4 "Checking to see if you have h_errno..."
3529$ OS
7558ebc2
PP
3530$ WS "#if defined(__DECC) || defined(__DECCXX)"
3531$ WS "#include <stdlib.h>"
3532$ WS "#endif"
3533$ WS "#include <stdio.h>"
3534$ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3535$ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
3536$ WS "int main()"
570bb66e 3537$ WS "{"
7558ebc2
PP
3538$ WS "h_errno = 3;"
3539$ WS "exit(0);"
570bb66e
JH
3540$ WS "}"
3541$ CS
3542$ GOSUB link_ok
3543$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3544$ THEN
3545$ d_herrno="define"
3546$ echo "You have h_errno."
3547$ ELSE
3548$ d_herrno="undef"
3549$ echo "You do not have h_errno."
3550$ ENDIF
3551$!
3552$! Check to see if gethostname exists
3553$!
3554$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
3555$ THEN
3556$ OS
7558ebc2
PP
3557$ WS "#if defined(__DECC) || defined(__DECCXX)"
3558$ WS "#include <stdlib.h>"
3559$ WS "#endif"
3560$ WS "#include <stdio.h>"
3561$ WS "#include <types.h>"
570bb66e
JH
3562$ IF Has_Socketshr
3563$ THEN
3564$ WS "#include <socketshr.h>"
3565$ ELSE
7558ebc2
PP
3566$ WS "#include <time.h>"
3567$ WS "#include <socket.h>"
570bb66e 3568$ ENDIF
7558ebc2 3569$ WS "int main()"
570bb66e 3570$ WS "{"
7558ebc2
PP
3571$ WS "char name[100];"
3572$ WS "int bar, baz;"
3573$ WS "bar = 100;"
3574$ WS "baz = gethostname(name, bar);"
3575$ WS "exit(0);"
570bb66e
JH
3576$ WS "}"
3577$ CS
3578$ GOSUB link_ok
3579$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3580$ THEN
3581$ d_gethname="define"
3582$ echo4 "gethostname() found."
3583$ ELSE
3584$ d_gethname="undef"
3585$ ENDIF
3586$ ELSE
3587$ ! No sockets, so no gethname
3588$ d_gethname = "undef"
3589$ ENDIF
3590$!
3591$! Check for sys/file.h
3592$!
3593$ tmp = "sys/file.h"
3594$ GOSUB inhdr
3595$ i_sysfile = tmp
3596$!
3597$! Check for sys/utsname.h
3598$!
3599$ tmp = "sys/utsname.h"
3600$ GOSUB inhdr
3601$ i_sysutsname = tmp
3602$!
3603$! Check for syslog.h
3604$!
3605$ tmp = "syslog.h"
3606$ GOSUB inhdr
3607$ i_syslog = tmp
3608$!
3609$! Check for poll.h
3610$!
3611$ tmp = "poll.h"
3612$ GOSUB inhdr
3613$ i_poll = tmp
3614$!
3615$! Check for sys/uio.h
3616$!
3617$ tmp = "sys/uio.h"
3618$ GOSUB inhdr
3619$ i_sysuio = tmp
3620$!
3621$! Check for sys/mode.h
3622$!
3623$ tmp = "sys/mode.h"
3624$ GOSUB inhdr
3625$ i_sysmode = tmp
3626$!
3627$! Check for sys/access.h
3628$!
3629$ tmp = "sys/access.h"
3630$ GOSUB inhdr
3631$ i_sysaccess = tmp
3632$!
3633$! Check for sys/security.h
3634$!
3635$ tmp = "sys/security.h"
3636$ GOSUB inhdr
3637$ i_syssecrt = tmp
3638$!
3639$! Check for fcntl.h
3640$!
3641$ tmp = "fcntl.h"
3642$ GOSUB inhdr
3643$ i_fcntl = tmp
3644$!
3645$! Check for fcntl
3646$!
3647$ OS
7558ebc2
PP
3648$ WS "#if defined(__DECC) || defined(__DECCXX)"
3649$ WS "#include <stdlib.h>"
3650$ WS "#endif"
3651$ WS "#include <stdio.h>"
3652$ WS "#include <fcntl.h>"
3653$ WS "int main()"
570bb66e 3654$ WS "{"
7558ebc2
PP
3655$ WS "fcntl(1,2,3);"
3656$ WS "exit(0);"
570bb66e
JH
3657$ WS "}"
3658$ CS
3659$ tmp = "fcntl"
3660$ GOSUB inlibc
3661$ d_fcntl = tmp
3662$!
c44c4826
CB
3663$! Check for fcntl locking capability
3664$!
3665$ echo4 "Checking if fcntl-based file locking works... "
3666$ tmp = "undef"
3667$ IF d_fcntl .EQS. "define"
3668$ THEN
3669$ OS
3670$ WS "#include <stdio.h>"
3671$ WS "#if defined(__DECC) || defined(__DECCXX)"
3672$ WS "#include <stdlib.h>"
3673$ WS "#endif"
3674$ WS "#include <fcntl.h>"
3675$ WS "#include <unistd.h>"
3676$ WS "int main() {"
3677$ WS "#if defined(F_SETLK) && defined(F_SETLKW)"
3678$ WS " struct flock flock;"
3679$ WS " int retval, fd;"
3680$ WS " fd = open(""try.c"", O_RDONLY);"
3681$ WS " flock.l_type = F_RDLCK;"
3682$ WS " flock.l_whence = SEEK_SET;"
3683$ WS " flock.l_start = flock.l_len = 0;"
3684$ WS " retval = fcntl(fd, F_SETLK, &flock);"
3685$ WS " close(fd);"
3686$ WS " (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
3687$ WS "#else"
3688$ WS " printf(""undef\n"");"
3689$ WS "#endif"
3690$ WS "}"
3691$ CS
3692$ GOSUB link_ok
3693$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3694$ THEN
3695$ GOSUB just_mcr_it
3696$ IF tmp .EQS. "define"
3697$ THEN
3698$ echo4 "Yes, it seems to work."
3699$ ELSE
3700$ echo4 "Nope, it didn't work."
3701$ ENDIF
3702$ ELSE
3703$ echo4 "I'm unable to compile the test program, so I'll assume not."
3704$ tmp = "undef"
3705$ ENDIF
3706$ ELSE
3707$ echo4 "Nope, since you don't even have fcntl()."
3708$ ENDIF
3709$ d_fcntl_can_lock = tmp
3710$!
570bb66e
JH
3711$! Check for memchr
3712$!
3713$ OS
7558ebc2
PP
3714$ WS "#if defined(__DECC) || defined(__DECCXX)"
3715$ WS "#include <stdlib.h>"
3716$ WS "#endif"
3717$ WS "#include <string.h>"
3718$ WS "int main()"
570bb66e 3719$ WS "{"
7558ebc2 3720$ WS "char * place;"
a5ff3b9a 3721$ WS "place = memchr(""foo"", 47, 3);"
7558ebc2 3722$ WS "exit(0);"
570bb66e
JH
3723$ WS "}"
3724$ CS
3725$ tmp = "memchr"
3726$ GOSUB inlibc
3727$ d_memchr = tmp
3728$!
3729$! Check for strtoull
3730$!
3731$ OS
7558ebc2
PP
3732$ WS "#if defined(__DECC) || defined(__DECCXX)"
3733$ WS "#include <stdlib.h>"
3734$ WS "#endif"
3735$ WS "#include <string.h>"
3736$ WS "int main()"
570bb66e 3737$ WS "{"
7558ebc2
PP
3738$ WS "unsigned __int64 result;"
3739$ WS "result = strtoull(""123123"", NULL, 10);"
3740$ WS "exit(0);"
570bb66e
JH
3741$ WS "}"
3742$ CS
3743$ tmp = "strtoull"
3744$ GOSUB inlibc
3745$ d_strtoull = tmp
3746$!
3747$! Check for strtouq
3748$!
3749$ OS
7558ebc2
PP
3750$ WS "#if defined(__DECC) || defined(__DECCXX)"
3751$ WS "#include <stdlib.h>"
3752$ WS "#endif"
3753$ WS "#include <string.h>"
3754$ WS "int main()"
570bb66e 3755$ WS "{"
7558ebc2
PP
3756$ WS "unsigned __int64 result;"
3757$ WS "result = strtouq(""123123"", NULL, 10);"
3758$ WS "exit(0);"
570bb66e
JH
3759$ WS "}"
3760$ CS
3761$ tmp = "strtouq"
3762$ GOSUB inlibc
3763$ d_strtouq = tmp
3764$!
3765$! Check for strtoll
3766$!
3767$ OS
7558ebc2
PP
3768$ WS "#if defined(__DECC) || defined(__DECCXX)"
3769$ WS "#include <stdlib.h>"
3770$ WS "#endif"
3771$ WS "#include <string.h>"
3772$ WS "int main()"
570bb66e 3773$ WS "{"
7558ebc2
PP
3774$ WS "__int64 result;"
3775$ WS "result = strtoll(""123123"", NULL, 10);"
3776$ WS "exit(0);"
570bb66e
JH
3777$ WS "}"
3778$ CS
3779$ tmp = "strtoll"
3780$ GOSUB inlibc
3781$ d_strtoll = tmp
3782$!
d0e6d399
NC
3783$! Check for strtoq
3784$!
3785$ OS
3786$ WS "#if defined(__DECC) || defined(__DECCXX)"
3787$ WS "#include <stdlib.h>"
28e5dec8
JH
3788$ WS "#endif"
3789$ WS "#include <string.h>"
3790$ WS "int main()"
3791$ WS "{"
3792$ WS "__int64 result;"
3793$ WS "result = strtoq(""123123"", NULL, 10);"
3794$ WS "exit(0);"
3795$ WS "}"
3796$ CS
3797$ tmp = "strtoq"
3798$ GOSUB inlibc
3799$ d_strtoq = tmp
3800$!
3801$! Check for strtoq
3802$!
3803$ OS
3804$ WS "#if defined(__DECC) || defined(__DECCXX)"
3805$ WS "#include <stdlib.h>"
d0e6d399
NC
3806$ WS "#endif"
3807$ WS "#include <string.h>"
3808$ WS "int main()"
3809$ WS "{"
3810$ WS "__int64 result;"
3811$ WS "result = strtoq(""123123"", NULL, 10);"
3812$ WS "exit(0);"
3813$ WS "}"
3814$ CS
3815$ tmp = "strtoq"
3816$ GOSUB inlibc
3817$ d_strtoq = tmp
3818$!
570bb66e
JH
3819$! Check for strtold
3820$!
3821$ OS
7558ebc2
PP
3822$ WS "#if defined(__DECC) || defined(__DECCXX)"
3823$ WS "#include <stdlib.h>"
3824$ WS "#endif"
3825$ WS "#include <string.h>"
3826$ WS "int main()"
570bb66e 3827$ WS "{"
7558ebc2
PP
3828$ WS "long double result;"
3829$ WS "result = strtold(""123123"", NULL, 10);"
3830$ WS "exit(0);"
570bb66e
JH
3831$ WS "}"
3832$ CS
3833$ tmp = "strtold"
3834$ GOSUB inlibc
3835$ d_strtold = tmp
3836$!
3837$! Check for atoll
3838$!
3839$ OS
7558ebc2
PP
3840$ WS "#if defined(__DECC) || defined(__DECCXX)"
3841$ WS "#include <stdlib.h>"
3842$ WS "#endif"
3843$ WS "#include <string.h>"
3844$ WS "int main()"
570bb66e 3845$ WS "{"
7558ebc2
PP
3846$ WS " __int64 result;"
3847$ WS "result = atoll(""123123"");"
3848$ WS "exit(0);"
570bb66e
JH
3849$ WS "}"
3850$ CS
3851$ tmp = "atoll"
3852$ GOSUB inlibc
3853$ d_atoll = tmp
3854$!
3855$! Check for atolf
3856$!
3857$ OS
7558ebc2
PP
3858$ WS "#if defined(__DECC) || defined(__DECCXX)"
3859$ WS "#include <stdlib.h>"
3860$ WS "#endif"
3861$ WS "#include <string.h>"
3862$ WS "int main()"
570bb66e 3863$ WS "{"
7558ebc2
PP
3864$ WS "long double"
3865$ WS "result = atolf(""123123"");"
3866$ WS "exit(0);"
570bb66e
JH
3867$ WS "}"
3868$ CS
3869$ tmp = "atolf"
3870$ GOSUB inlibc
3871$ d_atolf = tmp
3872$!
3873$! Check for access
3874$!
3875$ OS
7558ebc2
PP
3876$ WS "#if defined(__DECC) || defined(__DECCXX)"
3877$ WS "#include <stdlib.h>"
3878$ WS "#endif"
3879$ WS "#include <stdio.h>"
3880$ WS "int main()"
570bb66e 3881$ WS "{"
7558ebc2
PP
3882$ WS "access(""foo"", F_OK);"
3883$ WS "exit(0);"
570bb66e
JH
3884$ WS "}"
3885$ CS
3886$ tmp = "acess"
3887$ GOSUB inlibc
3888$ d_access = tmp
3889$!
3890$! Check for bzero
3891$!
3892$ OS
7558ebc2
PP
3893$ WS "#if defined(__DECC) || defined(__DECCXX)"
3894$ WS "#include <stdlib.h>"
3895$ WS "#endif"
3896$ WS "#include <stdio.h>"
3897$ WS "#include <strings.h>"
3898$ WS "int main()"
570bb66e 3899$ WS "{"
7558ebc2
PP
3900$ WS "char foo[10];"
3901$ WS "bzero(foo, 10);"
3902$ WS "exit(0);"
570bb66e
JH
3903$ WS "}"
3904$ CS
3905$ tmp = "bzero"
3906$ GOSUB inlibc
3907$ d_bzero = tmp
3908$!
3909$! Check for bcopy
3910$!
3911$ OS
7558ebc2
PP
3912$ WS "#if defined(__DECC) || defined(__DECCXX)"
3913$ WS "#include <stdlib.h>"
3914$ WS "#endif"
3915$ WS "#include <stdio.h>"
3916$ WS "#include <strings.h>"
3917$ WS "int main()"
570bb66e 3918$ WS "{"
7558ebc2
PP
3919$ WS "char foo[10], bar[10];"
3920$ WS "bcopy(""foo"", bar, 3);"
3921$ WS "exit(0);"
570bb66e
JH
3922$ WS "}"
3923$ CS
3924$ tmp = "bcopy"
3925$ GOSUB inlibc
3926$ d_bcopy = tmp
3927$!
3928$! Check for mkstemp
3929$!
3930$ OS
7558ebc2
PP
3931$ WS "#if defined(__DECC) || defined(__DECCXX)"
3932$ WS "#include <stdlib.h>"
3933$ WS "#endif"
3934$ WS "#include <stdio.h>"
3935$ WS "int main()"
570bb66e 3936$ WS "{"
7558ebc2
PP
3937$ WS "mkstemp(""foo"");"
3938$ WS "exit(0);"
570bb66e
JH
3939$ WS "}"
3940$ CS
3941$ tmp = "mkstemp"
3942$ GOSUB inlibc
3943$ d_mkstemp = tmp
3944$!
3945$! Check for mkstemps
3946$!
3947$ OS
7558ebc2
PP
3948$ WS "#if defined(__DECC) || defined(__DECCXX)"
3949$ WS "#include <stdlib.h>"
3950$ WS "#endif"
3951$ WS "#include <stdio.h>"
3952$ WS "int main()"
570bb66e 3953$ WS "{"
7558ebc2
PP
3954$ WS "mkstemps(""foo"", 1);"
3955$ WS "exit(0);"
570bb66e
JH
3956$ WS "}"
3957$ CS
3958$ tmp = "mkstemps"
3959$ GOSUB inlibc
3960$ d_mkstemps = tmp
3961$!
570bb66e
JH
3962$! Check for mkdtemp
3963$!
3964$ OS
7558ebc2
PP
3965$ WS "#if defined(__DECC) || defined(__DECCXX)"
3966$ WS "#include <stdlib.h>"
3967$ WS "#endif"
3968$ WS "#include <stdio.h>"
3969$ WS "int main()"
570bb66e 3970$ WS "{"
7558ebc2
PP
3971$ WS "mkdtemp(""foo"");"
3972$ WS "exit(0);"
570bb66e
JH
3973$ WS "}"
3974$ CS
3975$ tmp = "mkdtemp"
3976$ GOSUB inlibc
3977$ d_mkdtemp = tmp
3978$!
3979$! Check for setvbuf
3980$!
3981$ OS
7558ebc2
PP
3982$ WS "#if defined(__DECC) || defined(__DECCXX)"
3983$ WS "#include <stdlib.h>"
3984$ WS "#endif"
3985$ WS "#include <stdio.h>"
3986$ WS "int main()"
570bb66e 3987$ WS "{"
7558ebc2
PP
3988$ WS "FILE *foo;"
3989$ WS "char Buffer[99];"
3990$ WS "foo = fopen(""foo"", ""r"");"
3991$ WS "setvbuf(foo, Buffer, 0, 0);"
3992$ WS "exit(0);"
570bb66e
JH
3993$ WS "}"
3994$ CS
3995$ tmp = "setvbuf"
3996$ GOSUB inlibc
3997$ d_setvbuf = tmp
3998$!
c998f3c7
PP
3999$! see if sfio.h is available
4000$! see if sfio library is available
4001$! Ok, but do we want to use it.
4002$! IF F$TYPE(usesfio) .EQS. "" THEN usesfio = "undef"
4003$! IF val .EQS. "define"
4004$! THEN
4005$! IF usesfio .EQS. "define"
4006$! THEN dflt = "y"
4007$! ELSE dflt = "n"
4008$! ENDIF
4009$! echo "''package' can use the sfio library, but it is experimental."
4010$! IF useperlio .EQS. "undef"
4011$! THEN
4012$! echo "For sfio also the PerlIO abstraction layer is needed."
4013$! echo "Earlier you said you would not want that."
4014$! ENDIF
4015$! rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
4016$! GOSUB myread
4017$! IF ans .EQS. "" THEN ans = dflt
4018$! IF ans
4019$! THEN
4020$! echo "Ok, turning on both sfio and PerlIO, then."
4021$! useperlio="define"
4022$! val="define"
4023$! ELSE
4024$! echo "Ok, avoiding sfio this time. I'll use stdio instead."
4025$! val="undef"
4026$! ENDIF
4027$! ELSE
4028$! IF usesfio .EQS. "define"
4029$! THEN
4030$! echo4 "Sorry, cannot find sfio on this machine."
4031$! echo4 "Ignoring your setting of usesfio=''usesfio'."
4032$! val="undef"
4033$! ENDIF
4034$! ENDIF
4035$!
570bb66e
JH
4036$! Check for setenv
4037$!
4038$ OS
7558ebc2
PP
4039$ WS "#if defined(__DECC) || defined(__DECCXX)"
4040$ WS "#include <stdlib.h>"
4041$ WS "#endif"
4042$ WS "#include <stdio.h>"
4043$ WS "int main()"
570bb66e 4044$ WS "{"
7558ebc2
PP
4045$ WS "setenv(""FOO"", ""BAR"", 0);"
4046$ WS "exit(0);"
570bb66e
JH
4047$ WS "}"
4048$ CS
4049$ tmp = "setenv"
4050$ GOSUB inlibc
4051$ d_setenv = tmp
4052$!
4053$! Check for setproctitle
4054$!
4055$ OS
7558ebc2
PP
4056$ WS "#if defined(__DECC) || defined(__DECCXX)"
4057$ WS "#include <stdlib.h>"
4058$ WS "#endif"
4059$ WS "#include <stdio.h>"
4060$ WS "int main()"
570bb66e 4061$ WS "{"
7558ebc2
PP
4062$ WS "setproctitle(""%s"", ""FOO"");"
4063$ WS "exit(0);"
570bb66e
JH
4064$ WS "}"
4065$ CS
4066$ tmp = "setproctitle"
4067$ GOSUB inlibc
4068$ d_setproctitle = tmp
4069$!
4070$! Check for <netinet/in.h>
4071$!
4072$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4073$ THEN
4074$ tmp = "netinet/in.h"
4075$ GOSUB inhdr
4076$ i_niin = tmp
4077$ ELSE
4078$ i_niin="undef"
4079$ ENDIF
4080$!
4081$! Check for <netinet/tcp.h>
4082$!
4083$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4084$ THEN
4085$ tmp = "netinet/tcp.h"
4086$ GOSUB inhdr
4087$ i_netinettcp = tmp
4088$ ELSE
4089$ i_netinettcp="undef"
4090$ ENDIF
4091$!
4092$! Check for endhostent
4093$!
4094$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4095$ THEN
4096$ OS
7558ebc2
PP
4097$ WS "#if defined(__DECC) || defined(__DECCXX)"
4098$ WS "#include <stdlib.h>"
4099$ WS "#endif"
4100$ WS "#include <stdio.h>"
570bb66e
JH
4101$ IF Has_Socketshr
4102$ THEN WS "#include <socketshr.h>"
7558ebc2 4103$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4104$ ENDIF
7558ebc2 4105$ WS "int main()"
570bb66e 4106$ WS "{"
7558ebc2
PP
4107$ WS "endhostent();"
4108$ WS "exit(0);"
570bb66e
JH
4109$ WS "}"
4110$ CS
4111$ tmp = "endhostent"
4112$ GOSUB inlibc
4113$ d_endhent = tmp
4114$ ELSE
4115$ d_endhent="undef"
4116$ ENDIF
4117$!
4118$! Check for endnetent
4119$!
4120$ IF Has_Dec_C_Sockets .or. Has_Socketshr
4121$ THEN
4122$ OS
7558ebc2
PP
4123$ WS "#if defined(__DECC) || defined(__DECCXX)"
4124$ WS "#include <stdlib.h>"
4125$ WS "#endif"
4126$ WS "#include <stdio.h>"
570bb66e
JH
4127$ IF Has_Socketshr
4128$ THEN WS "#include <socketshr.h>"
7558ebc2 4129$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e
JH
4130$ ENDIF
4131$ WS "int main()"
4132$ WS "{"
4133$ WS "endnetent();"
4134$ WS "exit(0);"
4135$ WS "}"
4136$ CS
4137$ tmp = "endnetent"
4138$ GOSUB inlibc
4139$ d_endnent = tmp
4140$ ELSE
4141$ d_endnent="undef"
4142$ ENDIF
4143$!
4144$! Check for endprotoent
4145$!
4146$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4147$ THEN
4148$ OS
7558ebc2
PP
4149$ WS "#if defined(__DECC) || defined(__DECCXX)"
4150$ WS "#include <stdlib.h>"
4151$ WS "#endif"
4152$ WS "#include <stdio.h>"
570bb66e
JH
4153$ IF Has_Socketshr
4154$ THEN WS "#include <socketshr.h>"
7558ebc2 4155$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4156$ ENDIF
7558ebc2 4157$ WS "int main()"
570bb66e 4158$ WS "{"
7558ebc2
PP
4159$ WS "endprotoent();"
4160$ WS "exit(0);"
570bb66e
JH
4161$ WS "}"
4162$ CS
4163$ tmp = "endprotoent"
4164$ GOSUB inlibc
4165$ d_endpent = tmp
4166$ ELSE
4167$ d_endpent="undef"
4168$ ENDIF
4169$!
4170$! Check for endservent
4171$!
4172$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4173$ THEN
4174$ OS
7558ebc2
PP
4175$ WS "#if defined(__DECC) || defined(__DECCXX)"
4176$ WS "#include <stdlib.h>"
4177$ WS "#endif"
4178$ WS "#include <stdio.h>"
570bb66e
JH
4179$ IF Has_Socketshr
4180$ THEN WS "#include <socketshr.h>"
7558ebc2 4181$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4182$ ENDIF
7558ebc2 4183$ WS "int main()"
570bb66e 4184$ WS "{"
7558ebc2
PP
4185$ WS "endservent();"
4186$ WS "exit(0);"
570bb66e
JH
4187$ WS "}"
4188$ CS
4189$ tmp = "endservent"
4190$ GOSUB inlibc
4191$ d_endsent = tmp
4192$ ELSE
4193$ d_endsent="undef"
4194$ ENDIF
4195$!
4196$! Check for sethostent
4197$!
4198$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4199$ THEN
4200$ OS
7558ebc2
PP
4201$ WS "#if defined(__DECC) || defined(__DECCXX)"
4202$ WS "#include <stdlib.h>"
4203$ WS "#endif"
4204$ WS "#include <stdio.h>"
570bb66e
JH
4205$ IF Has_Socketshr
4206$ THEN WS "#include <socketshr.h>"
7558ebc2 4207$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4208$ ENDIF
7558ebc2 4209$ WS "int main()"
570bb66e 4210$ WS "{"
7558ebc2
PP
4211$ WS "sethostent(1);"
4212$ WS "exit(0);"
570bb66e
JH
4213$ WS "}"
4214$ CS
4215$ tmp = "sethostent"
4216$ GOSUB inlibc
4217$ d_sethent = tmp
4218$ ELSE
4219$ d_sethent="undef"
4220$ ENDIF
4221$!
4222$! Check for setnetent
4223$!
4224$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4225$ THEN
4226$ OS
7558ebc2
PP
4227$ WS "#if defined(__DECC) || defined(__DECCXX)"
4228$ WS "#include <stdlib.h>"
4229$ WS "#endif"
4230$ WS "#include <stdio.h>"
570bb66e
JH
4231$ IF Has_Socketshr
4232$ THEN WS "#include <socketshr.h>"
7558ebc2 4233$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4234$ ENDIF
7558ebc2 4235$ WS "int main()"
570bb66e 4236$ WS "{"
7558ebc2
PP
4237$ WS "setnetent(1);"
4238$ WS "exit(0);"
570bb66e
JH
4239$ WS "}"
4240$ CS
4241$ tmp = "setnetent"
4242$ GOSUB inlibc
4243$ d_setnent = tmp
4244$ ELSE
4245$ d_setnent="undef"
4246$ ENDIF
4247$!
4248$! Check for setprotoent
4249$!
4250$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4251$ THEN
4252$ OS
7558ebc2
PP
4253$ WS "#if defined(__DECC) || defined(__DECCXX)"
4254$ WS "#include <stdlib.h>"
4255$ WS "#endif"
4256$ WS "#include <stdio.h>"
570bb66e
JH
4257$ IF Has_Socketshr
4258$ THEN WS "#include <socketshr.h>"
7558ebc2 4259$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4260$ ENDIF
7558ebc2 4261$ WS "int main()"
570bb66e 4262$ WS "{"
7558ebc2
PP
4263$ WS "setprotoent(1);"
4264$ WS "exit(0);"
570bb66e
JH
4265$ WS "}"
4266$ CS
4267$ tmp = "setprotoent"
4268$ GOSUB inlibc
4269$ d_setpent = tmp
4270$ ELSE
4271$ d_setpent="undef"
4272$ ENDIF
4273$!
4274$! Check for setservent
4275$!
4276$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4277$ THEN
4278$ OS
7558ebc2
PP
4279$ WS "#if defined(__DECC) || defined(__DECCXX)"
4280$ WS "#include <stdlib.h>"
4281$ WS "#endif"
4282$ WS "#include <stdio.h>"
570bb66e
JH
4283$ IF Has_Socketshr
4284$ THEN WS "#include <socketshr.h>"
7558ebc2 4285$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4286$ ENDIF
7558ebc2 4287$ WS "int main()"
570bb66e 4288$ WS "{"
7558ebc2
PP
4289$ WS "setservent(1);"
4290$ WS "exit(0);"
570bb66e
JH
4291$ WS "}"
4292$ CS
4293$ tmp = "setservent"
4294$ GOSUB inlibc
4295$ d_setsent = tmp
4296$ ELSE
4297$ d_setsent="undef"
4298$ ENDIF
4299$!
4300$! Check for gethostent
4301$!
4302$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4303$ THEN
4304$ OS
7558ebc2
PP
4305$ WS "#if defined(__DECC) || defined(__DECCXX)"
4306$ WS "#include <stdlib.h>"
4307$ WS "#endif"
4308$ WS "#include <stdio.h>"
570bb66e
JH
4309$ IF Has_Socketshr
4310$ THEN WS "#include <socketshr.h>"
7558ebc2 4311$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4312$ ENDIF
7558ebc2 4313$ WS "int main()"
570bb66e 4314$ WS "{"
7558ebc2
PP
4315$ WS "gethostent();"
4316$ WS "exit(0);"
570bb66e
JH
4317$ WS "}"
4318$ CS
4319$ tmp = "gethostent"
4320$ GOSUB inlibc
4321$ d_gethent = tmp
4322$ ELSE
4323$ d_gethent="undef"
4324$ ENDIF
4325$!
4326$! Check for getnetent
4327$!
4328$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4329$ THEN
4330$ OS
7558ebc2
PP
4331$ WS "#if defined(__DECC) || defined(__DECCXX)"
4332$ WS "#include <stdlib.h>"
4333$ WS "#endif"
4334$ WS "#include <stdio.h>"
570bb66e
JH
4335$ IF Has_Socketshr
4336$ THEN WS "#include <socketshr.h>"
7558ebc2 4337$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4338$ ENDIF
7558ebc2 4339$ WS "int main()"
570bb66e 4340$ WS "{"
7558ebc2
PP
4341$ WS "getnetent();"
4342$ WS "exit(0);"
570bb66e
JH
4343$ WS "}"
4344$ CS
4345$ tmp = "getnetent"
4346$ GOSUB inlibc
4347$ d_getnent = tmp
4348$ ELSE
4349$ d_getnent="undef"
4350$ ENDIF
4351$!
4352$! Check for getprotoent
4353$!
4354$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4355$ THEN
4356$ OS
7558ebc2
PP
4357$ WS "#if defined(__DECC) || defined(__DECCXX)"
4358$ WS "#include <stdlib.h>"
4359$ WS "#endif"
4360$ WS "#include <stdio.h>"
570bb66e
JH
4361$ IF Has_Socketshr
4362$ THEN WS "#include <socketshr.h>"
7558ebc2 4363$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4364$ ENDIF
7558ebc2 4365$ WS "int main()"
570bb66e 4366$ WS "{"
7558ebc2
PP
4367$ WS "getprotoent();"
4368$ WS "exit(0);"
570bb66e
JH
4369$ WS "}"
4370$ CS
4371$ tmp = "getprotoent"
4372$ GOSUB inlibc
4373$ d_getpent = tmp
4374$ ELSE
4375$ d_getpent="undef"
4376$ ENDIF
4377$!
4378$! Check for getservent
4379$!
4380$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4381$ THEN
4382$ OS
7558ebc2
PP
4383$ WS "#if defined(__DECC) || defined(__DECCXX)"
4384$ WS "#include <stdlib.h>"
4385$ WS "#endif"
4386$ WS "#include <stdio.h>"
570bb66e
JH
4387$ IF Has_Socketshr
4388$ THEN WS "#include <socketshr.h>"
7558ebc2 4389$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4390$ ENDIF
7558ebc2 4391$ WS "int main()"
570bb66e 4392$ WS "{"
7558ebc2
PP
4393$ WS "getservent();"
4394$ WS "exit(0);"
570bb66e
JH
4395$ WS "}"
4396$ CS
4397$ tmp = "getservent"
4398$ GOSUB inlibc
4399$ d_getsent = tmp
4400$ ELSE
4401$ d_getsent="undef"
4402$ ENDIF
4403$!
4404$! Check for socklen_t
4405$!
4406$ IF Has_Dec_C_Sockets .OR. Has_Socketshr
4407$ THEN
4408$ echo4 "Checking to see if you have socklen_t..."
4409$ OS
7558ebc2
PP
4410$ WS "#if defined(__DECC) || defined(__DECCXX)"
4411$ WS "#include <stdlib.h>"
4412$ WS "#endif"
4413$ WS "#include <stdio.h>"
570bb66e
JH
4414$ IF Has_Socketshr
4415$ THEN WS "#include <socketshr.h>"
7558ebc2 4416$ ELSE IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
570bb66e 4417$ ENDIF
7558ebc2 4418$ WS "int main()"
570bb66e 4419$ WS "{"
7558ebc2
PP
4420$ WS "socklen_t x = 16;"
4421$ WS "exit(0);"
570bb66e
JH
4422$ WS "}"
4423$ CS
4424$ GOSUB link_ok
4425$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4426$ THEN
4427$ d_socklen_t="define"
4428$ echo "You have socklen_t."
4429$ ELSE
4430$ d_socklen_t="undef"
4431$ echo "You do not have socklen_t."
4432$ ENDIF
4433$ ELSE
4434$ d_socklen_t="undef"
4435$ ENDIF
4436$!
4437$! Check for pthread_yield
4438$!
4439$ IF use_threads
4440$ THEN
4441$ OS
7558ebc2
PP
4442$ WS "#if defined(__DECC) || defined(__DECCXX)"
4443$ WS "#include <stdlib.h>"
4444$ WS "#endif"
4445$ WS "#include <pthread.h>"
4446$ WS "#include <stdio.h>"
4447$ WS "int main()"
570bb66e 4448$ WS "{"
7558ebc2
PP
4449$ WS "pthread_yield();"
4450$ WS "exit(0);"
570bb66e
JH
4451$ WS "}"
4452$ CS
4453$ tmp = "pthread_yield"
4454$ GOSUB inlibc
4455$ d_pthread_yield = tmp
4456$ ELSE
4457$ d_pthread_yield="undef"
4458$ ENDIF
4459$!
4460$! Check for sched_yield
4461$!
4462$ IF use_threads
4463$ THEN
4464$ OS
7558ebc2
PP
4465$ WS "#if defined(__DECC) || defined(__DECCXX)"
4466$ WS "#include <stdlib.h>"
4467$ WS "#endif"
4468$ WS "#include <pthread.h>"
4469$ WS "#include <stdio.h>"
4470$ WS "int main()"
570bb66e 4471$ WS "{"
7558ebc2
PP
4472$ WS "sched_yield();"
4473$ WS "exit(0);"
570bb66e
JH
4474$ WS "}"
4475$ CS
4476$ tmp = "sched_yield"
4477$ GOSUB inlibc
4478$ d_sched_yield = tmp
4479$ IF d_sched_yield .EQS. "define"
4480$ THEN sched_yield = "sched_yield"
4481$ ELSE sched_yield = " "
4482$ ENDIF
4483$ ELSE
4484$ d_sched_yield="undef"
4485$ sched_yield = " "
4486$ ENDIF
4487$!
4488$! Check for generic pointer size
4489$!
4490$ echo4 "Checking to see how big your pointers are..."
4491$ OS
7558ebc2
PP
4492$ WS "#if defined(__DECC) || defined(__DECCXX)"
4493$ WS "#include <stdlib.h>"
4494$ WS "#endif"
4495$ WS "#include <stdio.h>"
4496$ WS "int main()"
570bb66e 4497$ WS "{"
7558ebc2
PP
4498$ WS "int foo;"
4499$ WS "foo = sizeof(char *);"
4500$ WS "printf(""%d\n"", foo);"
4501$ WS "exit(0);"
570bb66e
JH
4502$ WS "}"
4503$ CS
4504$ tmp = "char *"
4505$ GOSUB type_size_check
4506$ ptrsize = tmp
4507$ echo "Your pointers are ''ptrsize' bytes long."
4508$!
4509$! Check for size_t size
4510$!
4511$ tmp = "size_t"
4512$ zzz = tmp
4513$ echo4 "Checking the size of ''zzz'..."
4514$ GOSUB type_size_check
4515$ sizesize = tmp
4516$ echo "Your ''zzz' size is ''sizesize' bytes."
4517$!
4518$! Check rand48 and its ilk
4519$!
4520$ echo4 "Looking for a random number function..."
4521$ OS
7558ebc2
PP
4522$ WS "#if defined(__DECC) || defined(__DECCXX)"
4523$ WS "#include <stdlib.h>"
4524$ WS "#endif"
4525$ WS "#include <stdio.h>"
4526$ WS "int main()"
570bb66e
JH
4527$ WS "{"
4528$ WS "srand48(12L);"
7558ebc2 4529$ WS "exit(0);"
570bb66e
JH
4530$ WS "}"
4531$ CS
4532$ GOSUB link_ok
4533$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4534$ THEN
4535$ drand01 = "drand48()"
4536$ randseedtype = "long int"
4537$ seedfunc = "srand48"
4538$ echo4 "Good, found drand48()."
4539$ d_drand48proto = "define"
4540$ ELSE
4541$ d_drand48proto = "undef"
4542$ drand01="random()"
4543$ randseedtype = "unsigned"
4544$ seedfunc = "srandom"
4545$ OS
7558ebc2
PP
4546$ WS "#if defined(__DECC) || defined(__DECCXX)"
4547$ WS "#include <stdlib.h>"
4548$ WS "#endif"
4549$ WS "#include <stdio.h>"
4550$ WS "int main()"
570bb66e
JH
4551$ WS "{"
4552$ WS "srandom(12);"
7558ebc2 4553$ WS "exit(0);"
570bb66e
JH
4554$ WS "}"
4555$ CS
4556$ GOSUB link_ok
4557$ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4558$ THEN
4559$ echo4 "OK, found random()."
4560$ ELSE
96e176bf 4561$ drand01="(((float)rand())*MY_INV_RAND_MAX)"
570bb66e
JH
4562$ randseedtype = "unsigned"
4563$ seedfunc = "srand"
4564$ echo4 "Yick, looks like I have to use rand()."
4565$ ENDIF
4566$ ENDIF
570bb66e
JH
4567$! Done with compiler checks. Clean up.
4568$ IF F$SEARCH("try.c") .NES."" THEN DELETE/NOLOG/NOCONFIRM try.c;*
4569$ IF F$SEARCH("try.obj").NES."" THEN DELETE/NOLOG/NOCONFIRM try.obj;*
4570$ IF F$SEARCH("try.exe").NES."" THEN DELETE/NOLOG/NOCONFIRM try.exe;*
4571$ IF F$SEARCH("try.opt").NES."" THEN DELETE/NOLOG/NOCONFIRM try.opt;*
4572$ IF F$SEARCH("try.out").NES."" THEN DELETE/NOLOG/NOCONFIRM try.out;*
414b89cc 4573$ IF ccname .EQS. "CXX"
570bb66e
JH
4574$ THEN
4575$ CALL Cxx_demangler_cleanup
4576$ ENDIF
4577$!
4578$! Some that are compiler or VMS version sensitive
4579$!
4580$! Gnu C stuff
414b89cc 4581$ IF ccname .EQS. "GCC"
570bb66e
JH
4582$ THEN
4583$ d_attribut="define"
4584$ vms_cc_type="gcc"
4585$ ELSE
4586$ vms_cc_type="cc"
4587$ d_attribut="undef"
4588$ ENDIF
4589$!
4590$! Dec C >= 5.2 and VMS ver >= 7.0
414b89cc
CB
4591$ IF (ccname .EQS. "DEC") .AND. -
4592 (F$INTEGER(Dec_C_Version).GE.50200000) .AND. (vms_ver .GES. "7.0")
570bb66e
JH
4593$ THEN
4594$ d_bcmp="define"
10eefe7f 4595$ d_getitimer="define"
570bb66e 4596$ d_gettimeod="define"
10eefe7f
CB
4597$ d_mmap="define"
4598$ d_mprotect="define"
4599$ d_munmap="define"
4600$ d_msync="define"
4601$ d_ualarm="define"
570bb66e 4602$ d_uname="define"
10eefe7f
CB
4603$ d_usleep="define"
4604$ d_setitimer="define"
570bb66e 4605$ d_sigaction="define"
983dbef6 4606$ d_sigprocmask="define"
570bb66e
JH
4607$ d_truncate="define"
4608$ d_wait4="define"
4609$ d_index="define"
4610$ pidtype="pid_t"
4611$ 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"
4612$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4613$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",""SPARE18"",""SPARE19"",""CHLD"",""CONT"",""STOP"",""TSTP"","
4614$ psnwc3="""TTIN"",""TTOU"",""DEBUG"",""SPARE27"",""SPARE28"",""SPARE29"",""SPARE30"",""SPARE31"",""SPARE32"",""RTMIN"",""RTMAX"",0"
4615$ sig_name_init = psnwc1 + psnwc2 + psnwc3
7558ebc2 4616$ 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
4617$ 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"
4618$! perl_sig_num_with_commas=sig_num_init
6feaf546 4619$ sig_size="36"
570bb66e
JH
4620$ uidtype="uid_t"
4621$ d_pathconf="define"
4622$ d_fpathconf="define"
4623$ d_sysconf="define"
4624$ d_sigsetjmp="define"
4625$ ELSE
4626$ pidtype="unsigned int"
570bb66e 4627$ d_bcmp="undef"
10eefe7f
CB
4628$ d_getitimer="undef"
4629$ d_gettimeod="undef"
4630$ d_mmap="undef"
4631$ d_mprotect="undef"
4632$ d_munmap="undef"
4633$ d_msync="undef"
4634$ d_ualarm="undef"
570bb66e 4635$ d_uname="undef"
10eefe7f
CB
4636$ d_usleep="undef"
4637$ d_setitimer="undef"
570bb66e 4638$ d_sigaction="undef"
983dbef6 4639$ d_sigprocmask="undef"
570bb66e
JH
4640$ d_truncate="undef"
4641$ d_wait4="undef"
4642$ d_index="undef"
4643$ sig_name="ZERO HUP INT QUIT ILL TRAP IOT EMT FPE KILL BUS SEGV SYS PIPE ALRM TERM ABRT USR1 USR2"",0"
4644$ psnwc1="""ZERO"",""HUP"",""INT"",""QUIT"",""ILL"",""TRAP"",""IOT"",""EMT"",""FPE"",""KILL"",""BUS"",""SEGV"",""SYS"","
4645$ psnwc2="""PIPE"",""ALRM"",""TERM"",""ABRT"",""USR1"",""USR2"",0"
4646$ sig_name_init = psnwc1 + psnwc2
4647$ sig_num="0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 6 16 17"",0"
4648$ sig_num_init="0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,6,16,17,0"
4649$! perl_sig_num_with_commas=sig_num_init
6feaf546 4650$ sig_size="19"
570bb66e
JH
4651$ uidtype="unsigned int"
4652$ d_pathconf="undef"
4653$ d_fpathconf="undef"
4654$ d_sysconf="undef"
4655$ d_sigsetjmp="undef"
4656$ ENDIF
a3bd614a
PP
4657$!: see if tzname[] exists
4658$ OS
4659$ WS "#include <stdio.h>"
4660$ WS "#include <time.h>"
4661$ WS "int main() { extern short tzname[]; printf(""%hd"", tzname[0]); }"
4662$ CS
4663$ GOSUB compile_ok
4664$ IF compile_status .EQ. good_compile
4665$ THEN
4666$ d_tzname = "undef"
4667$ echo4 "tzname[] NOT found."
4668$ ELSE
4669$ d_tzname = "define"
4670$ echo4 "tzname[] found."
4671$ ENDIF
4672$ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
570bb66e 4673$!
414b89cc
CB
4674$ IF d_gethname .EQS. "undef" .AND. d_uname .EQS. "undef"
4675$ THEN
4676$ d_phostname="define"
4677$ ELSE
4678$ d_phostname="undef"
4679$ ENDIF
4680$!
570bb66e 4681$! Dec C alone
414b89cc 4682$ IF ccname .EQS. "DEC"
570bb66e
JH
4683$ THEN
4684$ d_mbstowcs="define"
4685$ d_mbtowc="define"
4686$ d_stdiobase="define"
4687$ d_stdio_cnt_lval="define"
dedcc4d4 4688$ d_stdio_ptr_lval="define"
570bb66e
JH
4689$ d_stdstdio="define"
4690$ d_wcstombs="define"
4691$ d_mblen="define"
4692$ d_mktime="define"
4693$ d_strcoll="define"
4694$ d_strxfrm="define"
4695$ d_wctomb="define"
4696$ i_locale="define"
2765b840 4697$ i_langinfo="define"
570bb66e 4698$ d_locconv="define"
2765b840 4699$ d_nl_langinfo="define"
570bb66e
JH
4700$ d_setlocale="define"
4701$ vms_cc_type="decc"
4702$ ELSE
4703$ d_mbstowcs="undef"
4704$ d_mbtowc="undef"
4705$ d_stdiobase="undef"
4706$ d_stdio_cnt_lval="undef"
4707$ d_stdio_ptr_lval="undef"
4708$ d_stdstdio="undef"
4709$ d_wcstombs="undef"
4710$ d_mblen="undef"
4711$ d_mktime="undef"
4712$ d_strcoll="undef"
4713$ d_strxfrm="undef"
4714$ d_wctomb="undef"
4715$ i_locale="undef"
2765b840 4716$ i_langinfo="undef"
570bb66e 4717$ d_locconv="undef"
2765b840 4718$ d_nl_langinfo="undef"
570bb66e
JH
4719$ d_setlocale="undef"
4720$ ENDIF
a7ffa9b9 4721$ d_stdio_ptr_lval_sets_cnt="undef"
a15cef0c 4722$ d_stdio_ptr_lval_nochange_cnt="define"
570bb66e
JH
4723$!
4724$! Sockets?
4725$ if Has_Socketshr .OR. Has_Dec_C_Sockets
4726$ THEN
4727$ d_vms_do_sockets="define"
4728$ d_htonl="define"
4729$ d_socket="define"
4730$ d_select="define"
4731$ netdb_hlen_type="int"
4732$ netdb_host_type="char *"
4733$ netdb_name_type="char *"
4734$ netdb_net_type="long"
4735$ d_gethbyaddr="define"
4736$ d_gethbyname="define"
4737$ d_getnbyaddr="define"
4738$ d_getnbyname="define"
4739$ d_getpbynumber="define"
4740$ d_getpbyname="define"
4741$ d_getsbyport="define"
4742$ d_getsbyname="define"
4743$ d_gethostprotos="define"
4744$ d_getnetprotos="define"
4745$ d_getprotoprotos="define"
4746$ d_getservprotos="define"
414b89cc 4747$ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
570bb66e
JH
4748$ THEN
4749$ socksizetype="unsigned int"
4750$ ELSE
4751$ socksizetype="int *"
4752$ ENDIF
4753$ ELSE
4754$ d_vms_do_sockets="undef"
4755$ d_htonl="undef"
4756$ d_socket="undef"
4757$ d_select="undef"
4758$ netdb_hlen_type="int"
4759$ netdb_host_type="char *"
4760$ netdb_name_type="char *"
4761$ netdb_net_type="long"
4762$ d_gethbyaddr="undef"
4763$ d_gethbyname="undef"
4764$ d_getnbyaddr="undef"
4765$ d_getnbyname="undef"
4766$ d_getpbynumber="undef"
4767$ d_getpbyname="undef"
4768$ d_getsbyport="undef"
4769$ d_getsbyname="undef"
4770$ d_gethostprotos="undef"
4771$ d_getnetprotos="undef"
4772$ d_getprotoprotos="undef"
4773$ d_getservprotos="undef"
4774$ socksizetype="undef"
4775$ ENDIF
4776$! Threads
4777$ IF use_threads
4778$ THEN
4779$ usethreads="define"
4780$ d_pthreads_created_joinable="define"
4781$ if (vms_ver .GES. "7.0")
4782$ THEN
4783$ d_oldpthreads="undef"
4784$ ELSE
4785$ d_oldpthreads="define"
4786$ ENDIF
4787$ ELSE
4788$ d_oldpthreads="undef"
4789$ usethreads="undef"
4790$ d_pthreads_created_joinable="undef"
4791$ ENDIF
4792$!
4793$! new (5.005_62++) typedefs for primitives
4794$!
4795$ echo "Choosing the C types to be used for Perl's internal types..."
4796$ ivtype="long"
4797$ uvtype="unsigned long"
4798$ i8type="char"
4799$ u8type="unsigned char"
4800$ i16type="short"
4801$ u16type="unsigned short"
4802$ i32type="int"
4803$ u32type="unsigned int"
4804$ i64type="long long"
4805$ u64type="unsigned long long"
4806$ nvtype="double"
4807$!
4808$ IF use64bitint .OR. use64bitint .EQS. "define"
4809$ THEN
4810$ ivtype = "''i64type'"
4811$ uvtype = "''u64type'"
4812$ nvtype="long double"
4813$ ELSE
4814$ i64size="undef"
4815$ u64size="undef"
4816$ ENDIF
4817$!
4818$ tmp = "''ivtype'"
4819$ GOSUB type_size_check
4820$ ivsize = tmp
4821$ IF use64bitint .OR. use64bitint .EQS. "define" THEN i64size = tmp
4822$ IF ivtype .eqs. "long"
4823$ THEN longsize = tmp
4824$ ELSE
4825$ tmp = "long"
4826$ GOSUB type_size_check
4827$ longsize = tmp
4828$ ENDIF
7558ebc2 4829$!
570bb66e
JH
4830$ tmp = "''uvtype'"
4831$ GOSUB type_size_check
4832$ uvsize = tmp
4833$ IF use64bitint .OR. use64bitint .EQS. "define" THEN u64size = tmp
7558ebc2 4834$!
570bb66e
JH
4835$ tmp = "''i8type'"
4836$ GOSUB type_size_check
4837$ i8size = tmp
7558ebc2 4838$!
570bb66e
JH
4839$ tmp = "''u8type'"
4840$ GOSUB type_size_check
4841$ u8size = tmp
7558ebc2 4842$!
570bb66e
JH
4843$ tmp = "''i16type'"
4844$ GOSUB type_size_check
4845$ i16size = tmp
4846$ IF i16type .eqs. "short"
4847$ THEN shortsize = tmp
4848$ ELSE
4849$ tmp = "short"
4850$ gosub type_size_check
4851$ shortsize = tmp
4852$ ENDIF
7558ebc2 4853$!
570bb66e
JH
4854$ tmp = "''u16type'"
4855$ GOSUB type_size_check
4856$ u16size = tmp
7558ebc2 4857$!
570bb66e
JH
4858$ tmp = "''i32type'"
4859$ GOSUB type_size_check
4860$ i32size = tmp
4861$ IF i32type .eqs. "int"
4862$ THEN intsize = tmp
4863$ ELSE
4864$ tmp = "int"
4865$ gosub type_size_check
4866$ intsize = tmp
4867$ ENDIF
7558ebc2 4868$!
570bb66e
JH
4869$ tmp = "''u32type'"
4870$ gosub type_size_check
4871$ u32size = tmp
7558ebc2 4872$!
570bb66e
JH
4873$ tmp = "''nvtype'"
4874$ GOSUB type_size_check
4875$ nvsize = tmp
4876$!
4877$ echo "(IV will be ""''ivtype'"", ''ivsize' bytes)"
4878$ echo "(UV will be ""''uvtype'"", ''uvsize' bytes)"
4879$ echo "(NV will be ""''nvtype'"", ''nvsize' bytes)"
4880$!
4881$ echo4 "Checking whether your NVs can preserve your UVs..."
4882$ OS
7558ebc2
PP
4883$ WS "#if defined(__DECC) || defined(__DECCXX)"
4884$ WS "#include <stdlib.h>"
4885$ WS "#endif"
4886$ WS "#include <stdio.h>"
4887$ WS "int main() {"
4888$ WS " ''uvtype' k = (''uvtype')~0, l;"
4889$ WS " ''nvtype' d;"
4890$ WS " l = k;"
4891$ WS " d = (''nvtype')l;"
4892$ WS " l = (''uvtype')d;"
4893$ WS " if (l == k)"
4894$ WS " printf(""preserve\n"");"
4895$ WS " exit(0);"
4896$ WS "}"
570bb66e
JH
4897$ CS
4898$ GOSUB compile
4899$ IF tmp .EQS. "preserve"
4900$ THEN
4901$ d_nv_preserves_uv = "define"
4902$ echo "Yes, they can."
4903$ d_nv_preserves_uv_bits = F$STRING(F$INTEGER(uvsize) * 8)
4904$ ELSE
4905$ d_nv_preserves_uv = "undef"
4906$ echo "No, they can't."
4907$ echo4 "Checking how many bits of your UVs your NVs can preserve..."
4908$ OS
7558ebc2
PP
4909$ WS "#if defined(__DECC) || defined(__DECCXX)"
4910$ WS "#include <stdlib.h>"
4911$ WS "#endif"
4912$ WS "#include <stdio.h>"
4913$ WS "int main() {"
4914$ WS " ''uvtype' u = 0;"
4915$ WS " int n = 8 * ''uvsize';"
4916$ WS " int i;"
4917$ WS " for (i = 0; i < n; i++) {"
4918$ WS " u = u << 1 | (''uvtype')1;"
4919$ WS " if ((''uvtype')(''nvtype')u != u)"
4920$ WS " break;"
4921$ WS " }"
4922$ WS " printf(""%d\n"", i);"
4923$ WS " exit(0);"
4924$ WS "}"
570bb66e
JH
4925$ GOSUB compile
4926$ d_nv_preserves_uv_bits = tmp
4927$ ENDIF
4928$ DELETE/SYMBOL tmp
4929$!
570bb66e
JH
4930$! Finally the composite ones. All config
4931$!
4932$ myuname="''osname' ''myname' ''osvers' ''F$EDIT(hwname, "TRIM")'"
4933$!
414b89cc 4934$ IF ccname .EQS. "DEC"
570bb66e 4935$ THEN
a71134cc 4936$ ccflags="/Include=[]/Standard=Relaxed_ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
570bb66e 4937$ ENDIF
7558ebc2 4938$ i_dirent = "undef"
414b89cc 4939$ IF ccname .EQS. "CXX"
7558ebc2
PP
4940$ THEN
4941$ i_dirent = "define"
a71134cc 4942$ ccflags="/Include=[]/Standard=ANSI/Prefix=All/Obj=''obj_ext' ''ccflags'"
7558ebc2 4943$ ENDIF
570bb66e
JH
4944$ IF use_vmsdebug_perl
4945$ THEN
a71134cc 4946$ optimize="/List/Debug/NoOpt"
31963e90 4947$ ldflags="/Debug/Trace/Map"
570bb66e
JH
4948$ dbgprefix = "DBG"
4949$ ELSE
a71134cc 4950$ optimize= "/NoList"
31963e90 4951$ ldflags="/NoTrace/NoMap"
570bb66e
JH
4952$ dbgprefix = ""
4953$ ENDIF
4954$!
4955$! Okay, we've got everything configured. Now go write out a config.sh.
4956$ basename_config_sh = F$PARSE(config_sh,,,"NAME",)+F$PARSE(config_sh,,,"TYPE",)
4957$ echo4 "Creating ''basename_config_sh'..."
7558ebc2 4958$ open/write CONFIG 'config_sh'
570bb66e
JH
4959$ WC := write CONFIG
4960$!
4961$! ##BEGIN WRITE NEW CONSTANTS HERE##
4962$!
4963$ WC "#!/bin/sh"
4964$ WC "#"
4965$ WC "# This file was produced by Configure.COM on a ''osname' system."
4966$ WC "#"
4967$ WC "# Package name : ''package'"
4968$ WC "# Source directory : ''src'"
4969$ WC "# Configuration time: " + cf_time
4970$ WC "# Configuration by : " + cf_by
4971$ WC "# Target system : " + myuname
4972$ WC ""
4973$ WC "CONFIG='true'"
4974$ WC "Makefile_SH='" + Makefile_SH + "'"
4975$ WC "Mcc='" + Mcc + "'"
414b89cc
CB
4976$ WC "PERL_REVISION='" + revision + "'"
4977$ WC "PERL_VERSION='" + patchlevel + "'"
4978$ WC "PERL_SUBVERSION='" + subversion + "'"
4979$ WC "PERL_API_VERSION='" + api_version + "'"
4980$ WC "PERL_API_SUBVERSION='" + api_subversion + "'"
570bb66e 4981$ WC "alignbytes='" + alignbytes + "'"
414b89cc 4982$ WC "aphostname='write sys$output f$edit(f$getsyi(\""SCSNODE\""),\""TRIM,LOWERCASE\"")'"
570bb66e
JH
4983$ WC "ar='" + "'"
4984$ WC "archlib='" + archlib + "'"
4985$ WC "archlibexp='" + archlibexp + "'"
4986$ WC "archname='" + archname + "'"
4987$ WC "baserev='" + baserev + "'"
4988$ WC "bin='" + bin + "'"
4989$ WC "binexp='" + binexp + "'"
4990$ WC "builddir='" + builddir + "'"
4991$ WC "byteorder='1234'"
4992$ WC "castflags='0'"
4993$ WC "cc='" + perl_cc + "'"
4994$ WC "cccdlflags='" + cccdlflags + "'"
4995$ WC "ccdlflags='" + ccdlflags + "'"
4996$ WC "ccflags='" + ccflags + "'"
414b89cc 4997$ WC "ccname='" + ccname + "'"
7558ebc2 4998$ WC "ccversion='" + ccversion + "'"
570bb66e
JH
4999$ WC "cf_by='" + cf_by + "'"
5000$ WC "cf_email='" + cf_email + "'"
5001$ WC "cf_time='" + cf_time + "'"
5002$ WC "config_args='" + config_args + "'"
5003$ WC "config_sh='" + config_sh + "'"
5004$ WC "cpp_stuff='" + cpp_stuff + "'"
5005$ WC "cpplast='" + cpplast + "'"
5006$ WC "cppminus='" + cppminus + "'"
5007$ WC "cpprun='" + cpprun + "'"
5008$ WC "cppstdin='" + cppstdin + "'"
9fd42072
JP
5009$ IF use64bitint .OR. use64bitint .EQS. "define"
5010$ THEN
5011$! gcvt() does not work for > 16 decimal places; fallback to sprintf
5012$ WC "d_Gconvert='sprintf((b),""%.*" + (nvgformat-"""") + ",(n),(x))'"
5013$ ELSE
5014$ WC "d_Gconvert='my_gconvert(x,n,t,b)'"
5015$ ENDIF
6b356c8e
JH
5016$ WC "d_PRIEldbl='" + d_PRIEUldbl + "'"
5017$ WC "d_PRIFldbl='" + d_PRIFUldbl + "'"
5018$ WC "d_PRIGldbl='" + d_PRIGUldbl + "'"
842bcadf 5019$ WC "d_PRIXU64='" + d_PRIXU64 + "'"
2ef53570 5020$ WC "d_PRId64='" + d_PRId64 + "'"
59a27e12 5021$ WC "d_PRIeldbl='" + d_PRIeldbl + "'"
570bb66e
JH
5022$ WC "d_PRIfldbl='" + d_PRIfldbl + "'"
5023$ WC "d_PRIgldbl='" + d_PRIgldbl + "'"
5024$ WC "d_PRIo64='" + d_PRIo64 + "'"
5025$ WC "d_PRIu64='" + d_PRIu64 + "'"
5026$ WC "d_PRIx64='" + d_PRIx64 + "'"
b5ddfb46 5027$ WC "d_SCNfldbl='" + d_SCNfldbl + "'"
2ef53570 5028$ WC "d__fwalk='undef'"
570bb66e
JH
5029$ WC "d_access='" + d_access + "'"
5030$ WC "d_accessx='undef'"
5031$ WC "d_alarm='define'"
5032$ WC "d_archlib='define'"
5033$ WC "d_atolf='" + d_atolf + "'"
5034$ WC "d_atoll='" + d_atoll + "'"
5035$ WC "d_attribut='" + d_attribut + "'"
5036$ WC "d_bcmp='" + d_bcmp + "'"
5037$ WC "d_bcopy='" + d_bcopy + "'"
5038$ WC "d_bincompat3='undef'"
5039$ WC "d_bincompat5005='undef'"
570bb66e 5040$! WC "d_bsdpgrp='undef'"
2ef53570 5041$ WC "d_bsdgetpgrp='undef'"
570bb66e
JH
5042$ WC "d_bsdsetpgrp='undef'"
5043$ WC "d_bzero='" + d_bzero + "'"
5044$ WC "d_casti32='define'"
5045$ WC "d_castneg='define'"
5046$ WC "d_charvspr='undef'"
5047$ WC "d_chown='define'"
5048$ WC "d_chroot='undef'"
5049$ WC "d_chsize='undef'"
758a5d79 5050$ WC "d_class='undef'"
570bb66e
JH
5051$ WC "d_cmsghdr_s='undef'"
5052$ WC "d_const='define'"
5053$ WC "d_crypt='define'"
5054$ WC "d_csh='undef'"
5055$ WC "d_cuserid='define'"
5056$ WC "d_dbl_dig='define'"
2ef53570 5057$ WC "d_dbminitproto='undef'"
570bb66e
JH
5058$ WC "d_difftime='define'"
5059$ WC "d_dirnamlen='define'"
5060$ WC "d_dlerror='undef'"
5061$ WC "d_dlsymun='undef'"
5062$ WC "d_dosuid='undef'"
5063$ WC "d_drand48proto='" + d_drand48proto + "'"
5064$ WC "d_dup2='define'"
5065$ WC "d_eaccess='undef'"
5066$ WC "d_endgrent='define'"
5067$ WC "d_endhent='" + d_endhent + "'"
5068$ WC "d_endnent='" + d_endnent + "'"
5069$ WC "d_endpent='" + d_endpent + "'"
5070$ WC "d_endpwent='define'"
5071$ WC "d_endsent='" + d_endsent + "'"
5072$ WC "d_eofnblk='undef'"
5073$ WC "d_eunice='undef'"
5074$ WC "d_fchmod='undef'"
b363b713 5075$ WC "d_fchdir='undef'"
570bb66e
JH
5076$ WC "d_fchown='undef'"
5077$ WC "d_fcntl='" + d_fcntl + "'"
1c21a19a 5078$ WC "d_fcntl_can_lock='" + d_fcntl_can_lock + "'"
570bb66e
JH
5079$ WC "d_fd_set='" + d_fd_set + "'"
5080$ WC "d_fgetpos='define'"
758a5d79
JH
5081$ WC "d_finite='undef'"
5082$ WC "d_finitel='undef'"
570bb66e
JH
5083$ WC "d_flexfnam='define'"
5084$ WC "d_flock='undef'"
2ef53570 5085$ WC "d_flockproto='undef'"
570bb66e 5086$ WC "d_fork='undef'"
758a5d79 5087$ WC "d_fp_class='undef'"
570bb66e 5088$ WC "d_fpathconf='" + d_fpathconf + "'"
758a5d79
JH
5089$ WC "d_fpclass='undef'"
5090$ WC "d_fpclassify='undef'"
5091$ WC "d_fpclassl='undef'"
570bb66e
JH
5092$ WC "d_fpos64_t='" + d_fpos64_t + "'"
5093$ WC "d_frexpl='" + d_frexpl + "'"
5094$ WC "d_fs_data_s='undef'"
5095$ WC "d_fseeko='undef'"
5096$ WC "d_fsetpos='define'"
5097$ WC "d_fstatfs='undef'"
5098$ WC "d_fstatvfs='undef'"
411ab01c 5099$ WC "d_fsync='undef'"
570bb66e 5100$ WC "d_ftello='undef'"
fea629d8 5101$ WC "d_getcwd='define'"
570bb66e
JH
5102$ WC "d_getespwnam='undef'"
5103$ WC "d_getfsstat='undef'"
5104$ WC "d_getgrent='define'"
5105$ WC "d_getgrps='undef'"
5106$ WC "d_gethbyaddr='" + d_gethbyaddr + "'"
5107$ WC "d_gethbyname='" + d_gethbyname + "'"
5108$ WC "d_gethent='" + d_gethent + "'"
5109$ WC "d_gethname='" + d_gethname + "'"
5110$ WC "d_gethostprotos='" + d_gethostprotos + "'"
10eefe7f 5111$ WC "d_getitimer='" + d_getitimer + "'"
570bb66e
JH
5112$ WC "d_getlogin='define'"
5113$ WC "d_getmnt='undef'"
5114$ WC "d_getmntent='undef'"
5115$ WC "d_getnbyaddr='" + d_getnbyaddr + "'"
5116$ WC "d_getnbyname='" + d_getnbyname + "'"
5117$ WC "d_getnent='" + d_getnent + "'"
5118$ WC "d_getnetprotos='" + d_getnetprotos + "'"
0c0643d0 5119$ WC "d_getpagsz='undef'"
570bb66e
JH
5120$ WC "d_getpbyname='" + d_getpbyname + "'"
5121$ WC "d_getpbynumber='" + d_getpbynumber + "'"
5122$ WC "d_getpent='" + d_getpent + "'"
5123$ WC "d_getpgid='undef'"
5124$ WC "d_getpgrp2='undef'"
5125$ WC "d_getpgrp='undef'"
5126$ WC "d_getppid='undef'"
5127$ WC "d_getprior='undef'"
5128$ WC "d_getprotoprotos='" + d_getprotoprotos + "'"
5129$ WC "d_getprpwnam='undef'"
5130$ WC "d_getpwent='define'"
5131$ WC "d_getsbyname='" + d_getsbyname + "'"
5132$ WC "d_getsbyport='" + d_getsbyport + "'"
5133$ WC "d_getsent='" + d_getsent + "'"
5134$ WC "d_getservprotos='" + d_getservprotos + "'"
5135$ WC "d_getspnam='undef'"
5136$ WC "d_gettimeod='" + d_gettimeod + "'"
5137$ WC "d_gnulibc='undef'"
5138$ WC "d_grpasswd='undef'"
5139$ WC "d_hasmntopt='undef'"
5140$ WC "d_htonl='" + d_htonl + "'"
570bb66e
JH
5141$ WC "d_index='" + d_index + "'"
5142$ WC "d_inetaton='undef'"
5143$ WC "d_int64_t='" + d_int64_t + "'"
5144$ WC "d_isascii='define'"
758a5d79
JH
5145$ WC "d_isfinite='undef'"
5146$ WC "d_isinf='undef'"
3a491987 5147$ WC "d_isnan='" + d_isnan + "'"
570bb66e
JH
5148$ WC "d_isnanl='" + d_isnanl + "'"
5149$ WC "d_killpg='undef'"
5150$ WC "d_lchown='undef'"
5151$ WC "d_ldbl_dig='define'"
5152$ WC "d_link='undef'"
5153$ WC "d_llseek='undef'"
5154$ WC "d_locconv='" + d_locconv + "'"
5155$ WC "d_lockf='undef'"
5156$ WC "d_longdbl='" + d_longdbl + "'"
5157$ WC "d_longlong='" + d_longlong + "'"
5158$ WC "d_lseekproto='define'"
5159$ WC "d_lstat='undef'"
5160$ WC "d_madvise='undef'"
5161$ WC "d_mblen='" + d_mblen + "'"
5162$ WC "d_mbstowcs='" + d_mbstowcs + "'"
5163$ WC "d_mbtowc='" + d_mbtowc + "'"
5164$ WC "d_memchr='" + d_memchr + "'"
5165$ WC "d_memcmp='define'"
5166$ WC "d_memcpy='define'"
5167$ WC "d_memmove='define'"
5168$ WC "d_memset='define'"
5169$ WC "d_mkdir='define'"
5170$ WC "d_mkdtemp='" + d_mkdtemp + "'"
5171$ WC "d_mkfifo='undef'"
5172$ WC "d_mknod='undef'"
5173$ WC "d_mkstemp='" + d_mkstemp + "'"
5174$ WC "d_mkstemps='" + d_mkstemps + "'"
5175$ WC "d_mktime='" + d_mktime + "'"
10eefe7f 5176$ WC "d_mmap='" + d_mmap + "'"
570bb66e 5177$ WC "d_modfl='" + d_modfl + "'"
7b826da8 5178$ WC "d_modfl_pow32_bug='undef'"
10eefe7f 5179$ WC "d_mprotect='" + d_mprotect + "'"
570bb66e
JH
5180$ WC "d_msg='undef'"
5181$ WC "d_msg_ctrunc='undef'"
5182$ WC "d_msg_dontroute='undef'"
5183$ WC "d_msg_oob='undef'"
5184$ WC "d_msg_peek='undef'"
5185$ WC "d_msg_proxy='undef'"
5186$ WC "d_msghdr_s='undef'"
10eefe7f
CB
5187$ WC "d_msync='" + d_msync + "'"
5188$ WC "d_munmap='" + d_munmap + "'"
570bb66e
JH
5189$ WC "d_mymalloc='" + d_mymalloc + "'"
5190$ WC "d_nice='define'"
2765b840 5191$ WC "d_nl_langinfo='" + d_nl_langinfo + "'"
570bb66e
JH
5192$ WC "d_nv_preserves_uv='" + d_nv_preserves_uv + "'"
5193$ WC "d_nv_preserves_uv_bits='" + d_nv_preserves_uv_bits + "'"
5194$ WC "d_off64_t='" + d_off64_t + "'"
5195$ WC "d_old_pthread_create_joinable='" + d_old_pthread_create_joinable + "'"
5196$ WC "d_oldarchlib='define'"
5197$ WC "d_oldpthreads='" + d_oldpthreads + "'"
5198$ WC "d_open3='define'"
5199$ WC "d_pathconf='" + d_pathconf + "'"
5200$ WC "d_pause='define'"
5201$ WC "d_perl_otherlibdirs='undef'"
414b89cc 5202$ WC "d_phostname='" + d_phostname + "'"
570bb66e
JH
5203$ WC "d_pipe='define'"
5204$ WC "d_poll='undef'"
d6483fcc 5205$ WC "d_pthread_atfork='undef'"
570bb66e
JH
5206$ WC "d_pthread_yield='" + d_pthread_yield + "'"
5207$ WC "d_pthreads_created_joinable='" + d_pthreads_created_joinable + "'"
5208$ WC "d_pwage='undef'"
5209$ WC "d_pwchange='undef'"
5210$ WC "d_pwclass='undef'"
5211$ WC "d_pwcomment='define'"
5212$ WC "d_pwexpire='undef'"
5213$ WC "d_pwgecos='define'"
5214$ WC "d_pwpasswd='define'"
5215$ WC "d_pwquota='undef'"
5216$ WC "d_qgcvt='undef'"
5217$ WC "d_quad='" + d_quad + "'"
5218$ WC "d_readdir='define'"
5219$ WC "d_readlink='undef'"
5220$ WC "d_readv='undef'"
f42f5b4c 5221$ WC "d_realpath='undef'"
570bb66e
JH
5222$ WC "d_recvmsg='undef'"
5223$ WC "d_rename='define'"
5224$ WC "d_rewinddir='define'"
5225$ WC "d_rmdir='define'"
5226$ WC "d_safebcpy='undef'"
5227$ WC "d_safemcpy='define'"
5228$ WC "d_sanemcmp='define'"
414b89cc 5229$ WC "d_sbrkproto='define'"
570bb66e
JH
5230$ WC "d_sched_yield='" + d_sched_yield + "'"
5231$ WC "d_scm_rights='undef'"
5232$ WC "d_seekdir='define'"
5233$ WC "d_select='" + d_select + "'"
5234$ WC "d_sem='undef'"
5235$ WC "d_semctl_semid_ds='undef'"
5236$ WC "d_semctl_semun='undef'"
5237$ WC "d_sendmsg='undef'"
5238$ WC "d_setegid='undef'"
5239$ WC "d_setenv='" + d_setenv + "'"
5240$ WC "d_seteuid='undef'"
5241$ WC "d_setgrent='undef'"
5242$ WC "d_setgrps='undef'"
5243$ WC "d_sethent='" + d_sethent + "'"
10eefe7f 5244$ WC "d_setitimer='" + d_setitimer + "'"
570bb66e
JH
5245$ WC "d_setlinebuf='undef'"
5246$ WC "d_setlocale='" + d_setlocale + "'"
5247$ WC "d_setnent='" + d_setnent + "'"
5248$ WC "d_setpent='" + d_setpent + "'"
5249$ WC "d_setpgid='undef'"
5250$ WC "d_setpgrp2='undef'"
5251$ WC "d_setpgrp='undef'"
5252$ WC "d_setprior='undef'"
5253$ WC "d_setproctitle='" + d_setproctitle + "'"
5254$ WC "d_setpwent='define'"
5255$ WC "d_setregid='undef'"
5256$ WC "d_setresgid='undef'"
5257$ WC "d_setresuid='undef'"
5258$ WC "d_setreuid='undef'"
5259$ WC "d_setrgid='undef'"
5260$ WC "d_setruid='undef'"
5261$ WC "d_setsent='" + d_setsent + "'"
5262$ WC "d_setsid='undef'"
5263$ WC "d_setvbuf='" + d_setvbuf + "'"
5264$ WC "d_sfio='undef'"
5265$ WC "d_shm='undef'"
5266$ WC "d_shmatprototype='undef'"
5267$ WC "d_sigaction='" + d_sigaction + "'"
983dbef6 5268$ WC "d_sigprocmask='" + d_sigprocmask + "'"
570bb66e 5269$ WC "d_sigsetjmp='" + d_sigsetjmp + "'"
49a78c82 5270$ WC "d_sockatmark='undef'"
2ef53570 5271$ WC "d_sockatmarkproto='undef'"
570bb66e
JH
5272$ WC "d_socket='" + d_socket + "'"
5273$ WC "d_socklen_t='" + d_socklen_t + "'"
5274$ WC "d_sockpair='undef'"
1b9c9cf5 5275$ WC "d_socks5_init='undef'"
570bb66e 5276$ WC "d_sqrtl='define'"
eef837ea 5277$ WC "d_sresgproto='undef'"
2ef53570
JH
5278$ WC "d_sresgproto='undef'"
5279$ WC "d_sresproto='undef'"
f42f5b4c 5280$ WC "d_sresuproto='undef'"
570bb66e
JH
5281$ WC "d_statblks='undef'"
5282$ WC "d_statfs_f_flags='undef'"
5283$ WC "d_statfs_s='undef'"
5284$ WC "d_statfsflags='undef'"
5285$ WC "d_stdio_cnt_lval='" + d_stdio_cnt_lval + "'"
5286$ WC "d_stdio_ptr_lval='" + d_stdio_ptr_lval + "'"
a7ffa9b9 5287$ WC "d_stdio_ptr_lval_nochange_cnt='" + d_stdio_ptr_lval_nochange_cnt + "'"
2ef53570 5288$ WC "d_stdio_ptr_lval_sets_cnt='" + d_stdio_ptr_lval_sets_cnt + "'"
570bb66e
JH
5289$ WC "d_stdio_stream_array='undef'"
5290$ WC "d_stdiobase='" + d_stdiobase + "'"
5291$ WC "d_stdstdio='" + d_stdstdio + "'"
5292$ WC "d_strchr='define'"
5293$ WC "d_strcoll='" + d_strcoll + "'"
5294$ WC "d_strctcpy='define'"
5295$ WC "d_strerrm='strerror((e),vaxc$errno)'"
5296$ WC "d_strerror='define'"
b3c85772 5297$ WC "d_strftime='define'"
570bb66e
JH
5298$ WC "d_strtod='define'"
5299$ WC "d_strtol='define'"
5300$ WC "d_strtold='" + d_strtold + "'"
5301$ WC "d_strtoll='" + d_strtoll + "'"
d0e6d399 5302$ WC "d_strtoq='define'"
570bb66e
JH
5303$ WC "d_strtoul='define'"
5304$ WC "d_strtoull='" + d_strtoull + "'"
5305$ WC "d_strtouq='" + d_strtouq + "'"
5306$ WC "d_strxfrm='" + d_strxfrm + "'"
5307$ WC "d_suidsafe='undef'"
5308$ WC "d_symlink='undef'"
5309$ WC "d_syscall='undef'"
2ef53570 5310$ WC "d_syscallproto='undef'"
570bb66e
JH
5311$ WC "d_sysconf='" + d_sysconf + "'"
5312$ WC "d_syserrlst='undef'"
5313$ WC "d_system='define'"
5314$ WC "d_tcgetpgrp='undef'"
5315$ WC "d_tcsetpgrp='undef'"
5316$ WC "d_telldir='define'"
5317$ WC "d_telldirproto='define'"
5318$ WC "d_times='define'"
5319$ WC "d_truncate='" + d_truncate + "'"
a3bd614a 5320$ WC "d_tzname='" + d_tzname + "'"
4e0554ec 5321$ WC "d_u32align='define'"
10eefe7f 5322$ WC "d_ualarm='" + d_ualarm + "'"
570bb66e
JH
5323$ WC "d_umask='define'"
5324$ WC "d_uname='" + d_uname + "'"
5325$ WC "d_union_semun='undef'"
5326$ WC "d_unlink_all_versions='undef'"
758a5d79 5327$ WC "d_unordered='undef'"
10eefe7f
CB
5328$ WC "d_usleep='" + d_usleep + "'"
5329$ WC "d_usleepproto='" + d_usleep + "'"
570bb66e
JH
5330$ WC "d_ustat='undef'"
5331$ WC "d_vendorarch='undef'"
5332$ WC "d_vendorlib='undef'"
5333$ WC "d_vfork='define'"
5334$ WC "d_vms_case_sensitive_symbols='" + d_vms_be_case_sensitive + "'" ! VMS
5335$ WC "d_vms_do_sockets='" + d_vms_do_sockets + "'" ! VMS
5336$ WC "d_void_closedir='define'"
5337$ WC "d_volatile='define'"
5338$ WC "d_vprintf='define'"
5339$ WC "d_wait4='" + d_wait4 + "'"
5340$ WC "d_waitpid='define'"
5341$ WC "d_wcstombs='" + d_wcstombs + "'"
5342$ WC "d_wctomb='" + d_wctomb + "'"
5343$ WC "d_writev='undef'"
5344$ WC "db_hashtype=' '"
5345$ WC "db_prefixtype=' '"
5346$ WC "dbgprefix='" + dbgprefix + "'"
5347$ WC "defvoidused='15'"
5348$ WC "devtype='" + devtype + "'"
5349$ WC "direntrytype='struct dirent'"
5350$ WC "dlext='" + dlext + "'"
5351$ WC "dlobj='" + dlobj + "'"
5352$ WC "dlsrc='dl_vms.c'"
5353$ WC "doublesize='" + doublesize + "'"
5354$ WC "drand01='" + drand01 + "'"
a3bd614a
PP
5355$!
5356$! The extensions symbol may be quite long
5357$!
5358$ tmp = "dynamic_ext='" + extensions + "'"
5359$ WC/symbol tmp
5360$ DELETE/SYMBOL tmp
570bb66e
JH
5361$ WC "eagain=' '"
5362$ WC "ebcdic='undef'"
403396f3 5363$ WC "embedmymalloc='" + mymalloc + "'"
570bb66e
JH
5364$ WC "eunicefix=':'"
5365$ WC "exe_ext='" + exe_ext + "'"
a3bd614a
PP
5366$!
5367$! The extensions symbol may be quite long
5368$!
5369$ tmp = "extensions='" + extensions + "'"
5370$ WC/symbol tmp
5371$ DELETE/SYMBOL tmp
570bb66e
JH
5372$ WC "fflushNULL='define'"
5373$ WC "fflushall='undef'"
5374$ WC "fpostype='fpos_t'"
5375$ WC "freetype='void'"
5376$ WC "full_ar='" + "'"
5377$ WC "full_csh='" + " '"
5378$ WC "full_sed='_NLA0:'"
5379$ WC "gccversion='" + gccversion + "'"
5380$ WC "gidformat='lu'"
5381$ WC "gidsign='1'"
5382$ WC "gidsize='4'"
5383$ WC "gidtype='" + gidtype + "'"
5384$ WC "groupstype='Gid_t'"
5385$ WC "hint='none'"
5386$ WC "hintfile='" + "'"
5387$ WC "i16size='" + i16size + "'"
5388$ WC "i16type='" + i16type + "'"
5389$ WC "i32size='" + i32size + "'"
5390$ WC "i32type='" + i32type + "'"
5391$ WC "i64size='" + i64size + "'"
5392$ WC "i64type='" + i64type + "'"
5393$ WC "i8size='" + i8size + "'"
5394$ WC "i8type='" + i8type + "'"
5395$ WC "i_arpainet='undef'"
5396$ WC "i_dbm='undef'"
7558ebc2 5397$ WC "i_dirent='" + i_dirent + "'"
570bb66e
JH
5398$ WC "i_dlfcn='undef'"
5399$ WC "i_fcntl='" + i_fcntl + "'"
5400$ WC "i_float='define'"
758a5d79
JH
5401$ WC "i_fp='undef'"
5402$ WC "i_fp_class='undef'"
570bb66e 5403$ WC "i_grp='undef'"
570bb66e
JH
5404$ WC "i_ieeefp='undef'"
5405$ WC "i_inttypes='" + i_inttypes + "'"
2765b840 5406$ WC "i_langinfo='" + i_langinfo + "'"
570bb66e
JH
5407$ WC "i_libutil='" + i_libutil + "'"
5408$ WC "i_limits='define'"
5409$ WC "i_locale='" + i_locale + "'"
5410$ WC "i_machcthr='undef'"
5411$ WC "i_machcthreads='undef'"
5412$ WC "i_math='define'"
5413$ WC "i_memory='undef'"
5414$ WC "i_mntent='undef'"
5415$ WC "i_ndbm='undef'"
5416$ WC "i_netdb='" + i_netdb + "'"
5417$ WC "i_neterrno='define'"
5418$ WC "i_netinettcp='" + i_netinettcp + "'"
5419$ WC "i_niin='" + i_niin + "'"
5420$ WC "i_poll='" + i_poll + "'"
5421$ WC "i_prot='undef'"
5422$ WC "i_pthread='define'"
5423$ WC "i_pwd='undef'"
5424$ WC "i_rpcsvcdbm='undef'"
5425$ WC "i_sfio='undef'"
5426$ WC "i_sgtty='undef'"
5427$ WC "i_shadow='" + i_shadow + "'"
5428$ WC "i_socks='" + i_socks + "'"
5429$ WC "i_stdarg='define'"
5430$ WC "i_stddef='define'"
5431$ WC "i_stdlib='define'"
5432$ WC "i_string='define'"
5433$ WC "i_sunmath='undef'"
5434$ WC "i_sysaccess='" + i_sysaccess + "'"
5435$ WC "i_sysdir='undef'"
5436$ WC "i_sysfile='" + i_sysfile + "'"
5437$ WC "i_sysioctl='undef'"
5438$ WC "i_syslog='" + i_syslog + "'"
5439$ WC "i_sysmman='undef'"
5440$ WC "i_sysmode='" + i_sysmode + "'"
5441$ WC "i_sysmount='undef'"
5442$ WC "i_sysndir='undef'"
5443$ WC "i_sysparam='undef'"
5444$ WC "i_sysresrc='undef'"
5445$ WC "i_syssecrt='" + i_syssecrt + "'"
5446$ WC "i_sysselct='undef'"
49a78c82 5447$ WC "i_syssockio='undef'"
570bb66e
JH
5448$ WC "i_sysstat='define'"
5449$ WC "i_sysstatfs='undef'"
5450$ WC "i_sysstatvfs='undef'"
5451$ WC "i_systime='undef'"
5452$ WC "i_systimek='undef'"
5453$ WC "i_systimes='undef'"
5454$ WC "i_systypes='define'"
5455$ WC "i_sysuio='" + i_sysuio + "'"
5456$ WC "i_sysun='undef'"
5457$ WC "i_sysutsname='" + i_sysutsname + "'"
5458$ WC "i_sysvfs='undef'"
5459$ WC "i_syswait='undef'"
5460$ WC "i_termio='undef'"
5461$ WC "i_termios='undef'"
5462$ WC "i_time='define'"
5463$ WC "i_unistd='" + i_unistd + "'"
5464$ WC "i_ustat='undef'"
5465$ WC "i_utime='undef'"
5466$ WC "i_values='undef'"
5467$ WC "i_varargs='undef'"
5468$ WC "i_vfork='undef'"
5469$ WC "inc_version_list='0'"
5470$ WC "inc_version_list_init='0'"
5471$ WC "installarchlib='" + installarchlib + "'"
5472$ WC "installbin='" + installbin + "'"
5473$ WC "installman1dir='" + installman1dir + "'"
5474$ WC "installman3dir='" + installman3dir + "'"
5475$ WC "installprivlib='" + installprivlib + "'"
5476$ WC "installscript='" + installscript + "'"
5477$ WC "installsitearch='" + installsitearch + "'"
5478$ WC "installsitelib='" + installsitelib + "'"
5479$ WC "installusrbinperl='undef'"
5480$ WC "intsize='" + intsize + "'"
5481$ WC "ivdformat='" + ivdformat + "'"
5482$ WC "ivsize='" + ivsize + "'"
5483$ WC "ivtype='" + ivtype + "'"
a3bd614a
PP
5484$!
5485$! The known_extensions symbol may be quite long
5486$!
5487$ tmp = "known_extensions='" + known_extensions + "'"
5488$ WC/symbol tmp
5489$ DELETE/SYMBOL tmp
570bb66e
JH
5490$ WC "ld='" + ld + "'"
5491$ WC "lddlflags='/Share'"
f24fb74c 5492$ WC "ldflags='" + ldflags + "'"
570bb66e
JH
5493$ WC "lib_ext='" + lib_ext + "'"
5494$ WC "libc='" + libc + "'"
5495$ WC "libpth='/sys$share /sys$library'"
5496$ WC "libs='" + libs + "'"
5497$ WC "longdblsize='" + longdblsize + "'"
5498$ WC "longlongsize='" + longlongsize + "'"
5499$ WC "longsize='" + longsize + "'"
5500$ WC "lseeksize='4'"
5501$ WC "lseektype='int'"
5502$ WC "mab='" + "'"
5503$ WC "make='" + make + "'"
5504$ WC "malloctype='void *'"
5505$ WC "man1ext='rno'"
5506$ WC "man3ext='rno'"
10eefe7f 5507$ WC "mmaptype='void *'"
570bb66e
JH
5508$ WC "modetype='unsigned int'"
5509$ WC "multiarch='undef'"
5510$ WC "mydomain='" + mydomain + "'"
5511$ WC "myhostname='" + myhostname + "'"
5512$ WC "myuname='" + myuname + "'"
2cc61e15 5513$ WC "need_va_copy='undef'"
570bb66e
JH
5514$ WC "netdb_hlen_type='" + netdb_hlen_type + "'"
5515$ WC "netdb_host_type='" + netdb_host_type + "'"
5516$ WC "netdb_name_type='" + netdb_name_type + "'"
5517$ WC "netdb_net_type='" + netdb_net_type + "'"
fd47df60
JH
5518$ WC "nveformat='" + nveformat + "'"
5519$ WC "nvfformat='" + nvfformat + "'"
5520$ WC "nvgformat='" + nvgformat + "'"
570bb66e
JH
5521$ WC "nvsize='" + nvsize + "'"
5522$ WC "nvtype='" + nvtype + "'"
5523$ WC "o_nonblock=' '"
5524$ WC "obj_ext='" + obj_ext + "'"
5525$ WC "old_pthread_create_joinable='" + old_pthread_create_joinable + "'"
5526$ WC "oldarchlib='" + oldarchlib + "'"
5527$ WC "oldarchlibexp='" + oldarchlibexp + "'"
5528$ WC "optimize='" + optimize + "'"
5529$ WC "osname='" + osname + "'"
5530$ WC "osvers='" + osvers + "'"
5531$ WC "otherlibdirs='" + "'"
5532$ WC "package='" + package + "'"
5533$ WC "pager='" + pager + "'"
5534$ WC "patchlevel='" + patchlevel + "'"
5535$ WC "path_sep='|'"
5536$ WC "perl_root='" + perl_root + "'" ! VMS specific $trnlnm()
5537$ WC "perladmin='" + perladmin + "'"
94928b12 5538$ WC "perllibs='" + perllibs + "'"
570bb66e
JH
5539$ WC "pgflquota='" + pgflquota + "'"
5540$ WC "pidtype='" + pidtype + "'"
5541$ WC "pm_apiversion='" + version + "'"
5542$! WC "prefix='" + vms_prefix + "'"
5543$ WC "prefix='" + prefix + "'"
5544$ WC "privlib='" + privlib + "'"
5545$ WC "privlibexp='" + privlibexp + "'"
5546$ WC "prototype='define'"
5547$ WC "ptrsize='" + ptrsize + "'"
5548$ WC "quadkind='" + quadkind + "'"
5549$ WC "quadtype='" + quadtype + "'"
5550$ WC "randbits='31'"
5551$ WC "randseedtype='" + randseedtype + "'"
5552$ WC "ranlib='" + "'"
5553$ WC "rd_nodata=' '"
5554$ WC "revision='" + revision + "'"
570bb66e 5555$ WC "sPRId64='" + sPRId64 + "'"
6b356c8e
JH
5556$ WC "sPRIEldbl='" + sPRIEUldbl + "'"
5557$ WC "sPRIFldbl='" + sPRIFUldbl + "'"
5558$ WC "sPRIGldbl='" + sPRIGUldbl + "'"
5559$ WC "sPRIX64='" + sPRIXU64 + "'"
59a27e12 5560$ WC "sPRIeldbl='" + sPRIeldbl + "'"
570bb66e
JH
5561$ WC "sPRIfldbl='" + sPRIfldbl + "'"
5562$ WC "sPRIgldbl='" + sPRIgldbl + "'"
5563$! WC "sPRIi64='" + sPRIi64 + "'"
5564$ WC "sPRIo64='" + sPRIo64 + "'"
5565$ WC "sPRIu64='" + sPRIu64 + "'"
5566$ WC "sPRIx64='" + sPRIx64 + "'"
b5ddfb46 5567$ WC "sSCNfldbl='" + sSCNfldbl + "'"
570bb66e 5568$ WC "sched_yield='" + sched_yield + "'"
f688e3ac 5569$ WC "scriptdir='" + scriptdir + "'"
570bb66e
JH
5570$ WC "seedfunc='" + seedfunc + "'"
5571$ WC "selectminbits='32'"
5572$ WC "selecttype='" + selecttype + "'"
5573$ WC "sh='MCR'"
414b89cc 5574$ WC "shmattype='" + " '"
570bb66e
JH
5575$ WC "shortsize='" + shortsize + "'"
5576$ WC "shrplib='define'"
5577$ WC "sig_name='" + sig_name + "'"
5578$ tmp = "sig_name_init='" + sig_name_init + "'"
5579$ WC/symbol tmp
5580$ DELETE/SYMBOL tmp
5581$ WC "sig_num='" + sig_num + "'"
5582$ WC "sig_num_init='" + sig_num_init + "'"
76d3c696 5583$ WC "sig_size='" + sig_size + "'"
570bb66e
JH
5584$ WC "signal_t='" + signal_t + "'"
5585$ WC "sitearch='" + sitearch + "'"
5586$ WC "sitearchexp='" + sitearchexp + "'"
5587$ WC "sitelib='" + sitelib + "'"
5588$ WC "sitelib_stem='" + sitelib_stem + "'"
5589$ WC "sitelibexp='" + sitelibexp + "'"
5590$ WC "sizesize='" + sizesize + "'"
5591$ WC "sizetype='size_t'"
5592$ WC "so='" + so + "'"
5593$ WC "socksizetype='" + socksizetype + "'"
5594$ WC "spitshell='write sys$output '"
5595$ WC "src='" + src + "'"
5596$ WC "ssizetype='int'"
5597$ WC "startperl=" + startperl ! This one's special--no enclosing single quotes
17e8697d 5598$ WC "static_ext='" + static_ext + "'"
570bb66e
JH
5599$ WC "stdchar='" + stdchar + "'"
5600$ WC "stdio_base='((*fp)->_base)'"
5601$ WC "stdio_bufsiz='((*fp)->_cnt + (*fp)->_ptr - (*fp)->_base)'"
5602$ WC "stdio_cnt='((*fp)->_cnt)'"
5603$ WC "stdio_ptr='((*fp)->_ptr)'"
59a27e12 5604$ WC "stdio_stream_array=' " + "'"
570bb66e
JH
5605$ WC "subversion='" + subversion + "'"
5606$ WC "timetype='" + timetype + "'"
5607$ WC "u16size='" + u16size + "'"
5608$ WC "u16type='" + u16type + "'"
5609$ WC "u32size='" + u32size + "'"
5610$ WC "u32type='" + u32type + "'"
5611$ WC "u64size='" + u64size + "'"
5612$ WC "u64type='" + u64type + "'"
5613$ WC "u8size='" + u8size + "'"
5614$ WC "u8type='" + u8type + "'"
5615$ WC "uidformat='lu'"
5616$ WC "uidsign='1'"
5617$ WC "uidsize='4'"
5618$ WC "uidtype='" + uidtype + "'"
5619$ WC "uquadtype='" + uquadtype + "'"
5620$ WC "use5005threads='" + use5005threads + "'"
5621$ WC "use64bitall='" + use64bitall + "'"
5622$ WC "use64bitint='" + use64bitint + "'"
403396f3 5623$ WC "usedebugging_perl='" + use_debugging_perl + "'"
5440bc8e 5624$ WC "usecrosscompile='undef'"
570bb66e
JH
5625$ WC "usedl='" + usedl + "'"
5626$ WC "useithreads='" + useithreads + "'"
5627$ WC "uselargefiles='" + uselargefiles + "'"
5628$ WC "uselongdouble='" + uselongdouble + "'"
5629$ WC "usemorebits='" + usemorebits + "'"
5630$ WC "usemultiplicity='" + usemultiplicity + "'"
5631$ WC "usemymalloc='" + usemymalloc + "'"
c998f3c7 5632$ WC "useperlio='" + useperlio + "'"
570bb66e 5633$ WC "useposix='false'"
9514c62b 5634$ WC "usereentrant='undef'"
570bb66e
JH
5635$ WC "usesocks='undef'"
5636$ WC "usethreads='" + usethreads + "'"
5637$ WC "usevfork='true'"
5638$ WC "uvoformat='" + uvoformat + "'"
5639$ WC "uvsize='" + uvsize + "'"
5640$ WC "uvtype='" + uvtype + "'"
5641$ WC "uvuformat='" + uvuformat + "'"
5642$ WC "uvxformat='" + uvxformat + "'"
414b89cc 5643$ WC "uvXUformat='" + uvXUformat + "'"
570bb66e
JH
5644$ WC "vendorarchexp='" + "'"
5645$ WC "vendorlib_stem='" + "'"
5646$ WC "vendorlibexp='" + "'"
5647$ WC "version='" + version + "'"
5648$ WC "vms_cc_type='" + vms_cc_type + "'" ! VMS specific
5649$ WC "vms_prefix='" + vms_prefix + "'" ! VMS specific
5650$ WC "vms_ver='" + vms_ver + "'" ! VMS specific
5651$ WC "voidflags='15'"
5652$ WC "xs_apiversion='" + version + "'"
a02608de 5653$ WC "PERL_CONFIG_SH='true'"
570bb66e
JH
5654$!
5655$! ##END WRITE NEW CONSTANTS HERE##
5656$!
5657$ CLOSE CONFIG
5658$!
5659$! Okay, we've gotten here. Build munchconfig.exe
5660$ COPY/NOLOG [-.vms]munchconfig.c []
7558ebc2 5661$ COPY/NOLOG [-.vms]'Makefile_SH' []
570bb66e
JH
5662$ 'Perl_CC' munchconfig.c
5663$ IF Needs_Opt
5664$ THEN
5665$ OPEN/WRITE CONFIG []munchconfig.opt
414b89cc 5666$ IF ccname .EQS. "GCC"
570bb66e
JH
5667$ THEN
5668$ WRITE CONFIG "Gnu_CC:[000000]gcclib.olb/library"
5669$ ENDIF
5670$ WRITE CONFIG "Sys$Share:VAXCRTL/Share"
5671$ CLOSE CONFIG
5672$ 'ld' munchconfig.obj,munchconfig.opt/opt
5673$ DELETE/NOLOG/NOCONFIRM munchconfig.opt;
5674$ ELSE
5675$ 'ld' munchconfig.obj
5676$ ENDIF
5677$ IF F$SEARCH("munchconfig.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.obj;
5678$ IF F$SEARCH("munchconfig.c") .NES. "" THEN DELETE/NOLOG/NOCONFIRM munchconfig.c;
414b89cc 5679$ IF ccname .EQS. "CXX"
570bb66e
JH
5680$ THEN
5681$ CALL Cxx_demangler_cleanup
5682$ ENDIF
5683$!
5684$ IF alldone .EQS. ""
5685$ THEN
5686$ cat4 SYS$INPUT:
7558ebc2 5687$ DECK
570bb66e
JH
5688
5689If you'd like to make any changes to the config.sh file before I begin
5690to configure things, answer yes to the following question.
5691
7558ebc2 5692$ EOD
570bb66e 5693$ dflt="n"
a5fddd44 5694$ rp="Do you wish to edit ''basename_config_sh'? [''dflt'] "
570bb66e
JH
5695$ GOSUB myread
5696$ IF ans .EQS. "" then ans = dflt
5697$ IF ans
5698$ THEN
5699$ echo4 ""
5700$ echo4 "Be sure to type LOGOUT after you have edited the file,"
5701$ echo4 "then this procedure will resume."
5702$ echo4 ""
5703$ default = F$ENVIRONMENT("DEFAULT")
7558ebc2 5704$ DIRECTORY 'config_sh'
570bb66e
JH
5705$ SET DEFAULT [-]
5706$ SPAWN/WAIT
7558ebc2 5707$ SET DEFAULT 'default'
570bb66e
JH
5708$ ENDIF
5709$ ENDIF
5710$!
5711$ echo ""
5712$ echo4 "Adding ''osname' specific preprocessor commands."
5713$ !
5714$ ! we need an fdl file
5715$ CREATE [-]CONFIG.FDL
7558ebc2 5716$ DECK
570bb66e
JH
5717RECORD
5718 FORMAT STREAM_LF
7558ebc2 5719$ EOD
570bb66e
JH
5720$ CREATE /FDL=[-]CONFIG.FDL [-]CONFIG.LOCAL
5721$ ! First spit out the header info with the local defines (to get
5722$ ! around the 255 character command line limit)
5723$ OPEN/APPEND CONFIG [-]config.local
5724$ IF use_debugging_perl THEN WC "#define DEBUGGING"
5725$ IF use_two_pot_malloc THEN WC "#define TWO_POT_OPTIMIZE"
5726$ IF mymalloc THEN WC "#define EMBEDMYMALLOC"
5727$ IF use_pack_malloc THEN WC "#define PACK_MALLOC"
5728$ IF use_debugmalloc THEN WC "#define DEBUGGING_MSTATS"
414b89cc 5729$ IF ccname .EQS. "GCC" THEN WC "#define GNUC_ATTRIBUTE_CHECK"
570bb66e
JH
5730$ IF (Has_Dec_C_Sockets)
5731$ THEN
5732$ WC "#define VMS_DO_SOCKETS"
5733$ WC "#define DECCRTL_SOCKETS"
5734$ ELSE
5735$ IF Has_Socketshr THEN WC "#define VMS_DO_SOCKETS"
5736$ ENDIF
5737$! This is VMS-specific for now
5738$ WC "#''d_setenv' HAS_SETENV"
5739$ IF d_secintgenv THEN WC "#define SECURE_INTERNAL_GETENV"
5740$ IF d_alwdeftype THEN WC "#define ALWAYS_DEFTYPES"
5741$ IF use64bitint .OR. use64bitint .EQS. "define"
5742$ THEN
5743$ WC "#define USE_64_BIT_INT"
5744$ WC "#define USE_LONG_DOUBLE"
5745$ ENDIF
5746$ IF use64bitall .OR. use64bitall .EQS. "define" THEN -
5747 WC "#define USE_64_BIT_ALL"
5748$ IF be_case_sensitive THEN WC "#define VMS_WE_ARE_CASE_SENSITIVE"
5749$ IF d_herrno .EQS. "undef" THEN WC "#define NEED_AN_H_ERRNO"
5750$ WC "#define HAS_ENVGETENV"
5751$ WC "#define PERL_EXTERNAL_GLOB"
55315086
PP
5752$ IF archname .EQS. "VMS_VAX" .AND. -
5753 ccname .EQS. "DEC" .AND. -
5754 ccversion .LE. 50390006
5755$ THEN
5756$! Alas this does not help to build Fcntl
5757$! WC "#define PERL_IGNORE_FPUSIG SIGFPE"
5758$ ENDIF
570bb66e
JH
5759$ CLOSE CONFIG
5760$!
5761$ echo4 "Doing variable substitutions on .SH files..."
5762$ echo4 "Extracting config.h (with variable substitutions)"
5763$!
5764$! Now build the normal config.h
5765$ DEFINE/USER_MODE sys$output [-]config.main
7558ebc2 5766$ mcr []munchconfig 'config_sh' [-]config_h.sh
570bb66e
JH
5767$ ! Concatenate them together
5768$ copy [-]config.local,[-]config.main [-]config.h
5769$! Clean up
5770$ DELETE/NOLOG [-]CONFIG.MAIN;*
5771$ DELETE/NOLOG [-]CONFIG.LOCAL;*
5772$ DELETE/NOLOG [-]CONFIG.FDL;*
5773$!
414b89cc 5774$ IF ccname .EQS. "DEC"
570bb66e
JH
5775$ THEN
5776$ DECC_REPLACE = "DECC=decc=1"
5777$ ELSE
7558ebc2
PP
5778$ DECC_REPLACE = "DECC="
5779$ ENDIF
414b89cc 5780$ IF ccname .EQS. "CXX"
7558ebc2
PP
5781$ THEN
5782$ DECCXX_REPLACE = "DECCXX=DECCXX=1"
5783$ ELSE
5784$ DECCXX_REPLACE = "DECCXX="
570bb66e 5785$ ENDIF
414b89cc 5786$ IF ccname .EQS. "GCC"
570bb66e
JH
5787$ THEN
5788$ GNUC_REPLACE = "GNUC=gnuc=1"
5789$ ELSE
5790$ GNUC_REPLACE = "GNUC="
5791$ ENDIF
5792$ IF Has_Dec_C_Sockets
5793$ THEN
5794$ SOCKET_REPLACE = "SOCKET=DECC_SOCKETS=1"
5795$ ELSE
5796$ IF Has_Socketshr
5797$ THEN
5798$ SOCKET_REPLACE = "SOCKET=SOCKETSHR_SOCKETS=1"
5799$ ELSE
5800$ SOCKET_REPLACE = "SOCKET="
5801$ ENDIF
5802$ ENDIF
5803$ IF Use_Threads
5804$ THEN
5805$ IF (vms_ver .LES. "6.2")
5806$ THEN
5807$ THREAD_REPLACE = "THREAD=OLDTHREADED=1"
5808$ ELSE
5809$ THREAD_REPLACE = "THREAD=THREADED=1"
5810$ ENDIF
5811$ ELSE
5812$ THREAD_REPLACE = "THREAD="
5813$ ENDIF
5814$ IF mymalloc
5815$ THEN
5816$ MALLOC_REPLACE = "MALLOC=MALLOC=1"
5817$ ELSE
5818$ MALLOC_REPLACE = "MALLOC="
5819$ ENDIF
5820$ echo4 "Extracting ''defmakefile' (with variable substitutions)"
7558ebc2
PP
5821$ DEFINE/USER_MODE sys$output 'UUmakefile'
5822$ mcr []munchconfig 'config_sh' 'Makefile_SH' "''DECC_REPLACE'" -
5823 "''DECCXX_REPLACE'" "''ARCH_TYPE'" "''GNUC_REPLACE'" "''SOCKET_REPLACE'" -
5824 "''THREAD_REPLACE'" "''C_Compiler_Replace'" "''MALLOC_REPLACE'" -
5825 "''Thread_Live_Dangerously'" "PV=''version'" "FLAGS=FLAGS=''extra_flags'"
5826$! Clean up after ourselves
5827$ DELETE/NOLOG/NOCONFIRM []munchconfig.exe;
a3bd614a 5828$!
7558ebc2
PP
5829$ echo4 "Extracting make_ext.com (without variable substitutions)"
5830$ Create Sys$Disk:[-]make_ext.com
570bb66e 5831$ Deck/Dollar="$EndOfTpl$"
7558ebc2 5832$!++ make_ext.com
570bb66e
JH
5833$! NOTE: This file is extracted as part of the VMS configuration process.
5834$! Any changes made to it directly will be lost. If you need to make any
56aeb0ae 5835$! changes, please edit the template in Configure.Com instead.
570bb66e 5836$ def = F$Environment("Default")
a3bd614a
PP
5837$! p1 - how to invoke miniperl (passed in from descrip.mms)
5838$ p1 = F$Edit(p1,"Upcase,Compress,Trim")
5839$ If F$Locate("MCR ",p1).eq.0 Then p1 = F$Extract(3,255,p1)
5840$ miniperl = "$" + F$Search(F$Parse(p1,".Exe"))
5841$! p2 - how to invoke local make utility (passed in from descrip.mms)
5842$ makeutil = p2
5843$ if f$type('p2') .nes. "" then makeutil = 'p2'
5844$! p3 - make target (passed in from descrip.mms)
5845$ targ = F$Edit(p3,"Lowercase")
5846$ sts = 1
5847$ extensions = ""
5848$ open/read CONFIG config.sh
5849$ find_ext_loop:
5850$ read/end=end_ext_loop CONFIG line
5851$ if (f$extract(0,12,line) .NES. "extensions='")
5852$ then goto find_ext_loop
5853$ else extensions = f$extract(12,f$length(line),line) - "'"
5854$ endif
5855$ end_ext_loop:
5856$ close CONFIG
5857$ extensions = f$edit(extensions,"TRIM,COMPRESS")
570bb66e
JH
5858$ i = 0
5859$ next_ext:
a3bd614a
PP
5860$ ext = f$element(i," ",extensions)
5861$ If ext .eqs. " " .or. ext .eqs. "" Then Goto done
570bb66e
JH
5862$ Define/User_mode Perl_Env_Tables CLISYM_LOCAL
5863$ miniperl
7558ebc2 5864$ deck
570bb66e
JH
5865 ($extdir = $ENV{'ext'}) =~ s/::/./g;
5866 $extdir =~ s#/#.#g;
5867 if ($extdir =~ /^vms/i) { $extdir =~ s/vms/.vms.ext/i; }
5868 else { $extdir = ".ext.$extdir"; }
5869 ($ENV{'extdir'} = "[$extdir]");
5870 ($ENV{'up'} = ('-') x ($extdir =~ tr/././));
7558ebc2 5871$ eod
570bb66e
JH
5872$ Set Default &extdir
5873$ redesc = 0
5874$ If F$Locate("clean",targ) .eqs. F$Length(targ)
5875$ Then
7558ebc2
PP
5876$ Write Sys$Output ""
5877$ Write Sys$Output " Making ''ext' (dynamic)"
570bb66e
JH
5878$ On Error Then Goto done
5879$ If F$Search("Descrip.MMS") .eqs. ""
5880$ Then
5881$ redesc = 1
5882$ Else
5883$ If F$CvTime(F$File("Descrip.MMS","rdt")) .lts. -
5884 F$CvTime(F$File("Makefile.PL","rdt")) Then redesc = 1
5885$ EndIf
5886$ Else
5887$ Write Sys$Output "''targ'ing ''ext' . . ."
5888$ On Error Then Continue
5889$ EndIf
5890$ If redesc Then -
5891 miniperl "-I[''up'.lib]" Makefile.PL "INST_LIB=[''up'.lib]" "INST_ARCHLIB=[''up'.lib]"
5892$ makeutil 'targ'
5893$ i = i + 1
5894$ Set Def &def
5895$ Goto next_ext
5896$ done:
5897$ sts = $Status
5898$ Set Def &def
5899$ Exit sts
7558ebc2 5900$!-- make_ext.com
570bb66e
JH
5901$EndOfTpl$
5902$!
414b89cc
CB
5903$! Note that the /key qualifier to search, as in:
5904$! search README.* "=head"/key=(position=1)/window=0/output=extra.pods
5905$! is not supported on VMS V5.5-2, hence not used in extra_pods.com.
5906$!
5907$ echo4 "Extracting extra_pods.com (without variable substitutions)"
5908$ Create Sys$Disk:[-]extra_pods.com
5909$ Deck/Dollar="$EOExtra_Pods$"
5910$!++ extra_pods.com
5911$! NOTE: This file is extracted as part of the VMS configuration process.
5912$! Any changes made to it directly will be lost. If you need to make any
5913$! changes, please edit the template in Configure.Com instead.
5914$! Use FORCE if you've just podified a README.* file on VMS.
5915$ if f$search("extra.pods") .eqs. "" .or. P1 .eqs. "FORCE" then -
5916 search README.* "=head"/window=0/output=extra.pods
5917$ open/read/error=extra_close EXTRA extra.pods
5918$extra_loop:
5919$ read/error=extra_close/END_OF_FILE=extra_close EXTRA file
5920$ file_type = f$parse(file,,,"TYPE",) - "."
5921$ if file_type .nes. "VMS" .and. file_type .nes. "vms"
5922$ then
5923$ pod_file = "[.pod]perl''file_type'.pod"
5924$ file = file - "''f$parse(file,,,"VERSION",)'"
5925$ if p1 .eqs. "CLEAN"
5926$ then if f$search(pod_file) .nes. "" then delete/log 'pod_file';*
5927$ else
5928$ do_copy := false
5929$ if f$search(pod_file) .eqs. ""
5930$ then do_copy := true
5931$ else
5932$ file_rdt = f$cvtime(f$file_attributes(file,"RDT"))
5933$ pod_file_rdt = f$cvtime(f$file_attributes(pod_file,"RDT"))
5934$ if file_rdt .GTS. pod_file_rdt then do_copy := true
5935$ endif
5936$ if do_copy then copy/log/noconfirm 'file' 'pod_file'
5937$ endif
5938$ endif
5939$ goto extra_loop
5940$extra_close:
5941$ close EXTRA
5942$ if p1 .eqs. "CLEAN" .and. f$search("extra.pods;-1") .nes. "" then -
5943 purge/nolog extra.pods
5944$!-- extra_pods.com
5945$EOExtra_Pods$
97abc6ad 5946$!
146174a9 5947$! Warn of dangerous symbols or logical names
a4521476 5948$!
146174a9
CB
5949$Bad_environment: SUBROUTINE
5950$ Bad_env = ""
5951$ IF p2 .eqs. "SYMBOL"
5952$ THEN
7558ebc2 5953$ IF f$type('p1') .nes. "" THEN Bad_env := SYMBOL
146174a9
CB
5954$ ELSE
5955$ IF f$trnlnm(p1) .nes. "" THEN Bad_env := LOGICAL
5956$ ENDIF
5957$ IF Bad_env .eqs. "SYMBOL" .or. Bad_env .eqs. "LOGICAL"
a4521476
PP
5958$ THEN
5959$ IF f$search("config.msg") .nes. ""
5960$ THEN
5961$ OPEN/APPEND CONFIG config.msg
5962$ ELSE
5963$ OPEN/WRITE CONFIG config.msg
5964$ ENDIF
146174a9
CB
5965$ IF Bad_env .eqs. "SYMBOL"
5966$ THEN
5967$ WRITE CONFIG ""
5968$ WRITE CONFIG "Symbol name ''p1' found in environment as " + &p1
5969$ WRITE CONFIG " delete before building ''package' via:"
5970$ WRITE CONFIG " $ DELETE/SYMBOL/GLOBAL ''p1'"
5971$ IF f$locate("""",&p1) .ge. f$length(&p1)
5972$ THEN
7558ebc2 5973$ WRITE CONFIG " after building, testing, and installing ''package'"
146174a9
CB
5974$ WRITE CONFIG " restore the symbol with:"
5975$ WRITE CONFIG " $ ''p1' == """ + &p1 + """"
5976$ ENDIF
5977$ ENDIF
5978$ IF Bad_env .eqs. "LOGICAL"
5979$ THEN
5980$ WRITE CONFIG ""
5981$ WRITE CONFIG "Logical name ''p1' found in environment as " + f$trnlnm(p1)
5982$ WRITE CONFIG " deassign before building ''package'"
5983$ ENDIF
a4521476 5984$ CLOSE CONFIG
146174a9 5985$ Bad_env = ""
a4521476
PP
5986$ ENDIF
5987$ EXIT
146174a9 5988$ ENDSUBROUTINE ! Bad_environment
a4521476 5989$ echo ""
570bb66e 5990$ echo4 "Checking for dangerous pre-existing global symbols and logical names."
146174a9
CB
5991$ CALL Bad_environment "TMP"
5992$ CALL Bad_environment "LIB"
5993$ CALL Bad_environment "T"
5994$ CALL Bad_environment "FOO"
5995$ CALL Bad_environment "EXT"
a3bd614a
PP
5996$ CALL Bad_environment "SOME_LOGICAL_NAME_NOT_LIKELY"
5997$ CALL Bad_environment "DOWN_LOGICAL_NAME_NOT_LIKELY"
146174a9 5998$ CALL Bad_environment "TEST" "SYMBOL"
a4521476
PP
5999$ IF f$search("config.msg") .eqs. "" THEN echo "OK."
6000$!
97abc6ad
HM
6001$! %Config-I-VMS, write perl_setup.com here
6002$!
86fced14
CB
6003$ IF (.NOT.perl_symbol)
6004$ THEN
6005$ file_2_find = "[-]''packageup'.cld"
6006$ echo ""
570bb66e 6007$ echo4 "The perl.cld file is now being written..."
86fced14 6008$ OPEN/WRITE CONFIG 'file_2_find'
c645ec3f 6009$ ext = ".exe"
55315086 6010$ IF (sharedperl .AND. archname .EQS. "VMS_AXP") THEN ext := .AXE
86fced14
CB
6011$ IF (use_vmsdebug_perl)
6012$ THEN
6013$ WRITE CONFIG "define verb dbgperl"
570bb66e 6014$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]dbgperl''ext'")
86fced14
CB
6015$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6016$ WRITE CONFIG ""
6017$ WRITE CONFIG "define verb perl"
570bb66e 6018$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]ndbgPerl''ext'")
86fced14
CB
6019$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6020$ ELSE
6021$ WRITE CONFIG "define verb perl"
570bb66e 6022$ WRITE CONFIG F$FAO("!_!AS","image ''vms_prefix':[000000]perl''ext'")
86fced14
CB
6023$ WRITE CONFIG F$FAO("!_!AS","cliflags (foreign)")
6024$ ENDIF
6025$ CLOSE CONFIG
6026$ ENDIF ! (.NOT.perl_symbol)
97abc6ad 6027$ echo ""
570bb66e 6028$ echo4 "The perl_setup.com file is now being written..."
a3ef2c6f 6029$ file_2_find = "[-]perl_setup.com"
97abc6ad
HM
6030$ OPEN/WRITE CONFIG 'file_2_find'
6031$ WRITE CONFIG "$!"
6032$ WRITE CONFIG "$! Perl_Setup.com ''cf_time'"
6033$ IF cf_email.NES.perladmin
6034$ THEN
6035$ WRITE CONFIG "$! perl configured by ''cf_email'"
6036$ ELSE
6037$ WRITE CONFIG "$! This perl configured & administered by ''perladmin'"
6038$ ENDIF
6039$ WRITE CONFIG "$!"
3eeba6fb 6040$ prefix = prefix - "000000."
97abc6ad
HM
6041$ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN -
6042 prefix = prefix - "]" + ".]"
570bb66e 6043$ WRITE CONFIG "$ define/translation=concealed ''vms_prefix' ''prefix'"
86fced14 6044$ WRITE CONFIG "$ ext = "".exe"""
570bb66e 6045$ IF sharedperl
86fced14 6046$ THEN
570bb66e 6047$ write config "$ if f$getsyi(""HW_MODEL"") .ge. 1024 then ext = "".AXE"""
86fced14
CB
6048$ ENDIF
6049$ IF (perl_symbol)
6050$ THEN
6051$ IF (use_vmsdebug_perl)
6052$ THEN
570bb66e
JH
6053$ WRITE CONFIG "$ dbgperl :== $''vms_prefix':[000000]dbgPerl'ext'"
6054$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]ndbgPerl'ext'"
6055$ WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
86fced14 6056$ ELSE
570bb66e
JH
6057$ WRITE CONFIG "$ perl :== $''vms_prefix':[000000]Perl'ext'"
6058$ WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
86fced14
CB
6059$ ENDIF
6060$ ELSE ! .NOT.perl_symbol
6061$ IF (use_vmsdebug_perl)
6062$ THEN
570bb66e 6063$ WRITE CONFIG "$ define dbgPerlShr ''vms_prefix':[000000]dbgPerlShr'ext'"
86fced14 6064$ ELSE
570bb66e 6065$ WRITE CONFIG "$ define PerlShr ''vms_prefix':[000000]PerlShr'ext'"
86fced14
CB
6066$ ENDIF
6067$ IF perl_verb .EQS. "PROCESS"
6068$ THEN
570bb66e 6069$ WRITE CONFIG "$ set command ''vms_prefix':[000000]''packageup'.CLD"
86fced14
CB
6070$ ENDIF
6071$ ENDIF ! perl_symbol
570bb66e
JH
6072$ WRITE CONFIG "$ define/nolog pod2text ''vms_prefix':[lib.pod]pod2text.com"
6073$ WRITE CONFIG "$ define/nolog pod2html ''vms_prefix':[lib.pod]pod2html.com"
6074$ WRITE CONFIG "$ define/nolog pod2man ''vms_prefix':[lib.pod]pod2man.com"
3eeba6fb 6075$!
97abc6ad
HM
6076$ IF (tzneedset)
6077$ THEN
6078$ WRITE CONFIG "$ define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6079$ ELSE !leave in but commented out (in case setting was from perl :-)
6080$ WRITE CONFIG "$! define SYS$TIMEZONE_DIFFERENTIAL ''tzd'"
6081$ ENDIF
6082$ WRITE CONFIG "$!"
dab31494 6083$ WRITE CONFIG "$! Symbols for commonly used programs:"
97abc6ad 6084$ WRITE CONFIG "$!"
86fced14
CB
6085$ IF (perl_symbol)
6086$ THEN
570bb66e 6087$ WRITE CONFIG "$ Perldoc == ""'"+"'Perl' ''vms_prefix':[lib.pod]Perldoc.com -t"""
86fced14
CB
6088$ WRITE CONFIG "$ pod2text == ""'"+"'Perl' pod2text"""
6089$ WRITE CONFIG "$ pod2html == ""'"+"'Perl' pod2html"""
570bb66e 6090$ WRITE CONFIG "$ pod2latex == ""'"+"'Perl' ''vms_prefix':[lib.pod]pod2latex.com"""
86fced14 6091$ WRITE CONFIG "$!pod2man == ""'"+"'Perl' pod2man"""
570bb66e
JH
6092$ WRITE CONFIG "$!Perlbug == ""'"+"'Perl' ''vms_prefix':[lib]Perlbug.com"""
6093$ WRITE CONFIG "$ c2ph == ""'"+"'Perl' ''vms_prefix':[utils]c2ph.com"""
86fced14
CB
6094$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6095$ THEN
570bb66e 6096$ WRITE CONFIG "$ dprofpp == ""'"+"'Perl' ''vms_prefix':[utils]dprofpp.com"""
86fced14 6097$ ENDIF
570bb66e
JH
6098$ WRITE CONFIG "$ h2ph == ""'"+"'Perl' ''vms_prefix':[utils]h2ph.com"""
6099$ WRITE CONFIG "$ h2xs == ""'"+"'Perl' ''vms_prefix':[utils]h2xs.com"""
6100$ WRITE CONFIG "$!perlcc == ""'"+"'Perl' ''vms_prefix':[utils]perlcc.com"""
dab31494 6101$ WRITE CONFIG "$ perlivp == ""'"+"'Perl' ''vms_prefix':[utils]perlivp.com"""
570bb66e 6102$ WRITE CONFIG "$ splain == ""'"+"'Perl' ''vms_prefix':[utils]splain.com"""
86fced14 6103$ ELSE
570bb66e 6104$ WRITE CONFIG "$ Perldoc == ""Perl ''vms_prefix':[lib.pod]Perldoc.com -t"""
86fced14
CB
6105$ WRITE CONFIG "$ pod2text == ""Perl pod2text"""
6106$ WRITE CONFIG "$ pod2html == ""Perl pod2html"""
570bb66e 6107$ WRITE CONFIG "$ pod2latex == ""Perl ''vms_prefix':[lib.pod]pod2latex.com"""
86fced14 6108$ WRITE CONFIG "$!pod2man == ""Perl pod2man"""
570bb66e
JH
6109$ WRITE CONFIG "$!Perlbug == ""Perl ''vms_prefix':[lib]Perlbug.com"""
6110$ WRITE CONFIG "$ c2ph == ""Perl ''vms_prefix':[utils]c2ph.com"""
86fced14
CB
6111$ IF F$LOCATE("Devel::DProf",extensions) .LT. F$LENGTH(extensions)
6112$ THEN
570bb66e 6113$ WRITE CONFIG "$ dprofpp == ""Perl ''vms_prefix':[utils]dprofpp.com"""
86fced14 6114$ ENDIF
570bb66e
JH
6115$ WRITE CONFIG "$ h2ph == ""Perl ''vms_prefix':[utils]h2ph.com"""
6116$ WRITE CONFIG "$ h2xs == ""Perl ''vms_prefix':[utils]h2xs.com"""
6117$ WRITE CONFIG "$!perlcc == ""Perl ''vms_prefix':[utils]perlcc.com"""
dab31494 6118$ WRITE CONFIG "$ perlivp == ""Perl ''vms_prefix':[utils]perlivp.com"""
570bb66e 6119$ WRITE CONFIG "$ splain == ""Perl ''vms_prefix':[utils]splain.com"""
86fced14 6120$ ENDIF
97abc6ad
HM
6121$ CLOSE CONFIG
6122$!
6123$ echo ""
570bb66e
JH
6124$ echo "The file can be found at:"
6125$ echo4 " ''F$SEARCH(file_2_find)'"
6126$ echo "Add that file (or an @ call to it) to your [SY]LOGIN.COM"
6127$ echo "when you are satisfied with a successful compilation,"
6128$ echo "testing, and installation of your perl."
97abc6ad 6129$ echo ""
86fced14
CB
6130$ IF ((.NOT.perl_symbol) .AND. (perl_verb .EQS. "DCLTABLES"))
6131$ THEN
6132$ file_2_find = "[-]''packageup'_install.com"
7558ebc2 6133$ OPEN/WRITE CONFIG 'file_2_find'
86fced14
CB
6134$ WRITE CONFIG "$ set command perl /table=sys$common:[syslib]dcltables.exe -"
6135$ WRITE CONFIG " /output=sys$common:[syslib]dcltables.exe"
6136$ WRITE CONFIG "$ install replace sys$common:[syslib]dcltables.exe"
6137$ CLOSE CONFIG
6138$ echo4 ""
570bb66e
JH
6139$ echo4 "In order to install the ''packageup' verb into DCLTABLES run:"
6140$ echo4 " @ ''F$SEARCH(file_2_find)'"
6141$ echo4 "after a successful build, test, and install. Do so with CMKRNL privilege."
86fced14
CB
6142$ echo4 ""
6143$ ENDIF
97abc6ad
HM
6144$!
6145$!figure out where we "are" by parsing 'vms_default_directory_name'
6146$!
6147$ set_def_command = ""
6148$ dflt = F$ENVIRONMENT("DEFAULT") - ".UU]"
6149$ tmp = vms_default_directory_name - dflt - "]"
6150$ i = 0
6151$ IF tmp .EQS. "" THEN GOTO Beyond_set_def_loop
6152$Set_def_loop:
6153$ tmp1 = F$ELEMENT(i,".",tmp)
6154$ IF tmp1 .EQS. "." THEN GOTO Beyond_set_def_loop
6155$ IF i .EQ. 0
6156$ THEN set_def_command = "set default [-"
6157$ ELSE set_def_command = set_def_command + "-"
6158$ ENDIF
6159$ i = i + 1
6160$ GOTO Set_def_loop
6161$Beyond_set_def_loop:
6162$ IF set_def_command.NES.""
6163$ THEN
6164$ set_def_command = set_def_command - "-" + "]"
6165$ echo4 ""
6166$ echo4 "In order to build ''package' you must now issue the commands:"
6167$ echo4 ""
6168$ echo4 " ''set_def_command'"
6169$ ELSE
6170$ echo4 ""
6171$ echo4 "In order to build ''package' you must now issue the command:"
6172$ echo4 ""
6173$ ENDIF
6174$ echo4 " ''make'''makefile'", macros
6175$ echo4 ""
6176$!
a4521476
PP
6177$ IF ( F$SEARCH("config.msg").NES."" )
6178$ THEN
6179$ echo "Hmm. I also noted the following information while running:"
6180$ echo ""
6181$ type config.msg
6182$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) config.msg
6183$ DELETE/NOLOG/NOCONFIRM config.msg;
6184$ ENDIF
6185$!
97abc6ad
HM
6186$Clean_up:
6187$ IF (silent)
6188$ THEN
6189$ DEASSIGN SYS$OUTPUT
6190$! DEASSIGN SYS$ERROR
6191$ ENDIF
414b89cc
CB
6192$ IF F$GETJPI("","FILCNT").GT.vms_filcnt THEN CLOSE CONFIG
6193$ IF F$GETJPI("","FILCNT").GT.vms_filcnt
97abc6ad
HM
6194$ THEN WRITE SYS$ERROR "%Config-W-VMS, WARNING: There is a file still open"
6195$ ENDIF
6196$ dflt = F$ENVIRONMENT("DEFAULT")
6197$ IF F$LOCATE("UU]",dflt).EQS.(F$LENGTH(dflt)-3)
6198$ THEN
6199$ IF ( F$SEARCH("[]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM []*.*;*
6200$ SET DEFAULT [-]
6201$ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) UU.DIR
6202$ DELETE/NOLOG/NOCONFIRM UU.DIR;
6203$ ENDIF
6204$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
97abc6ad
HM
6205$ EXIT
6206$!: End of Configure