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