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