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