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