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