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