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