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