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