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