source: trunk/essentials/dev-lang/perl/configure.com@ 3394

Last change on this file since 3394 was 3181, checked in by bird, 19 years ago

perl 5.8.8

File size: 203.9 KB
Line 
1$! OpenVMS configuration procedure for Perl -- do not attempt to run under DOS
2$ sav_ver = 'F$VERIFY(0)'
3$ on control_y then goto clean_up
4$! SET VERIFY
5$!
6$! For example, if you unpacked perl into: [USER.PERL-5n...] then you will
7$! want to cd into the tree and execute Configure:
8$!
9$! $ SET DEFAULT [USER.PERL5_xxx]
10$! $ @Configure
11$!
12$! or
13$!
14$! $ SET DEFAULT [USER.PERL5_xxx]
15$! $ @Configure "-des"
16$!
17$! That's it. If you get into a bind trying to build perl on VMS then
18$! definitely read through the README.VMS file.
19$! Beyond that send email to [email protected]
20$!
21$! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
22$!
23$! send suggestions to:
24$! Dan Sugalski <[email protected]>
25$! Thank you!!!!
26$!
27$! Adapted and converted from Larry Wall & Andy Dougherty's
28$! "Configure generated by metaconfig 3.0 PL60." by Peter Prymmer
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)
31$! with much valuable help from Charles Bailey &
32$! the whole VMSPerl crew.
33$! Extended and messed about with by Dan Sugalski
34$!
35$! VMS-isms we will need:
36$ echo = "write sys$output "
37$ cat = "type"
38$ delete := delete ! local symbol overrides globals with qualifiers
39$ gcc_symbol = "gcc"
40$ ld = "Link/nodebug"
41$ ans = ""
42$ macros = ""
43$ extra_flags = ""
44$ user_c_flags = ""
45$ use_ieee_math = "y"
46$ be_case_sensitive = "n"
47$ unlink_all_versions = "n"
48$ builder = "MMK"
49$ use_vmsdebug_perl = "n"
50$ use64bitall = "n"
51$ use64bitint = "n"
52$ uselargefiles = "n"
53$ usesitecustomize = "n"
54$ C_Compiler_Replace = "CC="
55$ Thread_Live_Dangerously = "MT="
56$ use_two_pot_malloc = "N"
57$ use_pack_malloc = "N"
58$ use_debugmalloc = "N"
59$ ccflags = ""
60$ static_ext = ""
61$ nonxs_ext = ""
62$ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
63$ max_allowed_dir_depth = 3 ! e.g. [A.B.PERLxxx] not [A.B.C.PERLxxx]
64$! max_allowed_dir_depth = 2 ! e.g. [A.PERLxxx] not [A.B.PERLxxx]
65$!
66$! Sebastian Bazley's request: close the CONFIG handle with /NOLOG
67$! qualifier "just in case" (configure.com is re @ed in a bad state).
68$! This construct was tested to be not a problem as far back as
69$! VMS V5.5-2, hopefully earlier versions are OK as well.
70$!
71$ CLOSE/NOLOG CONFIG
72$!
73$! Now keep track of open files
74$!
75$ vms_filcnt = F$GETJPI ("","FILCNT")
76$!
77$!: compute my invocation name
78$ me = F$ENVIRONMENT("PROCEDURE")
79$!
80$! Many null statements (begin with colon ':') in the Bourne shell version of
81$! this script serve as comments/placeholders. I have retained some of the ones
82$! that will help you compare this .COM file to the sh version - as well as
83$! leave placeholders for future improvements to this .COM file.
84$! sfn = VMS "skipped for now"
85$!
86$!: Proper PATH separator !sfn
87$!: Proper PATH setting !sfn
88$!: Sanity checks !sfn "Say '@''$me''"
89$!: On HP-UX, large Configure scripts may exercise a bug in /bin/sh !sfn
90$!: Configure runs within the UU subdirectory !->after find MANIFEST
91$! <big long list of default values (mostly null)>
92$!: We must find out about Eunice early !(?)
93$!: list of known cpp symbols, sorted alphabetically !sfn
94$! al = al + "..."
95$!: default library list !sfn
96$! <no hints files in use (yet?)>
97$!: Extra object files, if any, needed on this platform. !sfn
98$!: Possible local include directories to search. !sfn
99$!: Set locincpth to "" in a hint file to defeat local include searches. !sfn
100$!locincpth="/usr/local/include /opt/local/include /usr/gnu/include" !sfn
101$!locincpth="$locincpth /opt/gnu/include /usr/GNU/include /opt/GNU/include"
102$!: no include file wanted by default !sfn
103$!inclwanted='' !sfn
104$!: Possible local library directories to search. !sfn
105$!loclibpth="/usr/local/lib /opt/local/lib /usr/gnu/lib" !sfn
106$!loclibpth="$loclibpth /opt/gnu/lib /usr/GNU/lib /opt/GNU/lib" !sfn
107$!: general looking path for locating libraries !sfn
108$!glibpth="/lib/pa1.1 /usr/shlib /usr/lib/large /lib /usr/lib" !sfn
109$!glibpth="$glibpth $xlibpth /lib/large /usr/lib/small /lib/small" !sfn
110$!glibpth="$glibpth /usr/ccs/lib /usr/ucblib /usr/shlib" !sfn
111$!: Private path used by Configure to find libraries. Its value !sfn
112$!: is prepended to libpth. This variable takes care of special !sfn
113$!: machines, like the mips. Usually, it should be empty. !sfn
114$!plibpth='' !sfn
115$!: full support for void wanted by default !sfn
116$!defvoidused=15 !sfn
117$!: List of libraries we want. !sfn
118$!libswanted='net socket inet nsl nm ndbm gdbm dbm db malloc dl' !sfn
119$!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
120$!libswanted="$libswanted ucb bsd BSD PW x" !sfn
121$!: We probably want to search /usr/shlib before most other libraries. !sfn
122$!: This is only used by the lib/ExtUtils/MakeMaker.pm routine extliblist. !sfn
123$!glibpth=`echo " $glibpth " | sed -e 's! /usr/shlib ! !'` !sfn
124$!glibpth="/usr/shlib $glibpth" !sfn
125$!: Do not use vfork unless overridden by a hint file. !sfn
126$!usevfork=false !sfn
127$!: script used to extract .SH files with variable substitutions !sfn
128$!: produce awk script to parse command line options !sfn
129$!sfn (assume no sed awk) see below
130$!: process the command line options
131$!
132$!: set up default values
133$ fastread=""
134$ reuseval="false"
135$ maniskip = "false"
136$ IF F$TYPE(config_sh) .EQS. "" THEN config_sh=""
137$ alldone=""
138$ error=""
139$ silent=""
140$ extractsh=""
141$ override=""
142$ knowitall=""
143$ ccname="VAX"
144$ Dec_C_Version = ""
145$ cxxversion = ""
146$ use_threads = "F"
147$ use_5005_threads = "N"
148$ use_ithreads = "N"
149$!
150$!: option parsing
151$ config_args = ""
152$ IF (P1 .NES. "")
153$ THEN !one or more switches was thrown
154$ i = 1
155$ bang = 0
156$Param_loop:
157$ IF (P'i'.NES."")
158$ THEN
159$ bang = bang + 1
160$ config_args = config_args + F$FAO(" !AS",P'i')
161$ ENDIF
162$ i = i + 1
163$ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
164$!
165$ i = 1
166$Opt_loop:
167$ IF (F$EXTRACT(0,1,P'i') .EQS. "-") THEN P'i' = P'i' - "-"
168$ IF (F$EXTRACT(0,1,P'i') .EQS. "/") THEN P'i' = P'i' - "/"
169$Remove_quotation_mark:
170$ P'i' = P'i' - """"
171$ IF F$LOCATE("""",P'i') .LT. F$LENGTH(P'i') THEN GOTO Remove_quotation_mark
172$ gotopt = "f" !"alse"
173$ gotshortopt = "f" !"alse"
174$ IF (F$EXTRACT(0,1,P'i') .EQS. "d")
175$ THEN
176$ fastread = "yes"
177$ gotopt = "t" !"rue"
178$ P'i' = P'i' - "d"
179$ gotshortopt = "t" !"rue"
180$ ENDIF
181$ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
182$ THEN
183$ alldone = "cont"
184$ gotopt = "t"
185$ P'i' = P'i' - "e"
186$ gotshortopt = "t"
187$ ENDIF
188$ IF (F$EXTRACT(0,1,P'i') .EQS. "f") ! "-f"
189$ THEN
190$ P'i' = P'i' - "f"
191$ config_sh = P'i'
192$ IF (F$SEARCH(config_sh).NES."")
193$ THEN
194$ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
195$ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
196$ THEN
197$ config_dflt = "y"
198$ CONTINUE !at this point check UIC && if test allows...
199$ !to be continued ?
200$ ELSE
201$ echo "''me': cannot read config file ''config_sh'."
202$ error="true"
203$ ENDIF
204$ ELSE
205$ echo "''me': cannot read config file ''config_sh'."
206$ error="true"
207$ ENDIF
208$ gotopt = "t"
209$ ENDIF
210$ IF (F$EXTRACT(0,1,P'i') .EQS. "h") ! "-h"
211$ THEN
212$ error = "true"
213$ gotopt = "t"
214$ P'i' = P'i' - "h"
215$ gotshortopt = "t"
216$ ENDIF
217$ IF (F$EXTRACT(0,1,P'i') .EQS. "m") ! "-m"
218$ THEN
219$ maniskip = "true"
220$ gotopt = "t"
221$ P'i' = P'i' - "m"
222$ gotshortopt = "t"
223$ ENDIF
224$ IF (F$EXTRACT(0,1,P'i') .EQS. "r") ! "-r"
225$ THEN
226$ reuseval = "true"
227$ gotopt = "t"
228$ P'i' = P'i' - "r"
229$ gotshortopt = "t"
230$ ENDIF
231$ IF (F$EXTRACT(0,1,P'i') .EQS. "s") ! "-s"
232$ THEN
233$ silent = "true"
234$ gotopt = "t"
235$ P'i' = P'i' - "s"
236$ gotshortopt = "t"
237$ ENDIF
238$ IF (F$EXTRACT(0,1,P'i') .EQS. "E") ! "-E"
239$ THEN
240$ alldone = "exit"
241$ gotopt = "t"
242$ ENDIF
243$ IF (F$EXTRACT(0,1,P'i') .EQS. "K") ! "-K"
244$ THEN
245$ knowitall = "true"
246$ gotopt = "t"
247$ P'i' = P'i' - "K"
248$ gotshortopt = "t"
249$ ENDIF
250$ IF (F$EXTRACT(0,1,P'i') .EQS. "O") ! "-O"
251$ THEN
252$ override = "true"
253$ gotopt = "t"
254$ P'i' = P'i' - "O"
255$ gotshortopt = "t"
256$ ENDIF
257$ IF (F$EXTRACT(0,1,P'i') .EQS. "S") ! "-S"
258$ THEN
259$ extractsh = "true" !VMS? Yes with munchconfig
260$ gotopt = "t"
261$ P'i' = P'i' - "S"
262$ gotshortopt = "t"
263$ ENDIF
264$ IF (F$EXTRACT(0,1,P'i') .EQS. "D") ! "-D"
265$ THEN
266$ P'i' = P'i' - "D"
267$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
268$ THEN
269$ tmp = P'i' + "=""define"""
270$ 'tmp'
271$ DELETE/SYMBOL tmp
272$ ELSE
273$ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
274$ THEN
275$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
276$ echo "''me': use ""-Usymbol=val"" not ""-Dsymbol=""."
277$ echo "''me': ignoring -D",P'i'
278$ ELSE
279$ tmp = F$EXTRACT(0,F$LOCATE("=",P'i'),P'i')
280$ tmp = tmp + "=""" + F$EXTRACT(F$LOCATE("=",P'i')+1,F$LENGTH(P'i'),P'i') + """"
281$ 'tmp'
282$ DELETE/SYMBOL tmp
283$ ENDIF
284$ ENDIF
285$ gotopt = "t"
286$ ENDIF
287$ IF (F$EXTRACT(0,1,P'i') .EQS. "U") ! "-U"
288$ THEN
289$ P'i' = P'i' - "U"
290$ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
291$ THEN
292$ tmp = P'i' + "="""""
293$ 'tmp'
294$ DELETE/SYMBOL tmp
295$ ELSE
296$ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
297$ THEN
298$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
299$ echo "''me': use ""-Dsymbol=val"" not ""-Usymbol=val""."
300$ echo "''me': ignoring -U",P'i'
301$ ELSE
302$ tmp = P'i' + "=""undef"""
303$ 'tmp'
304$ DELETE/SYMBOL tmp
305$ ENDIF
306$ ENDIF
307$ gotopt = "t"
308$ ENDIF
309$ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
310$ THEN
311$ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
312$ echo "''me' generated by an unknown version of EDT."
313$ STOP
314$ EXIT
315$ ENDIF
316$ IF .NOT.gotopt
317$ THEN
318$ echo "''me': unknown option ",P'i'
319$ error = "true"
320$ ENDIF
321$ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
322$ i = i + 1
323$ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
324$!
325$ ENDIF ! (P1 .NES. "")
326$ config_args = F$EDIT(config_args,"TRIM")
327$!
328$ IF (error)
329$ THEN
330$ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
331$ echo "Usage: @''me' [-dehmr""EKOSV""] [-fconfig.sh] [""-Dsymbol""] [""-Dsymbol=value""]"
332$ echo " [-Usymbol] [-Usymbol=]"
333$ TYPE SYS$INPUT:
334$ DECK
335 "-d" : use defaults for all answers.
336 "-e" : go on without questioning past the production of config.sh. *
337 "-f" : specify an alternate default configuration file.
338 "-h" : print this help message and exit (with an error status).
339 "-m" : skip the MANIFEST check to see that all files are present
340 "-r" : reuse C symbols value if possible (skips costly nm extraction).*
341 "-s" : silent mode, only echoes questions and essential information.
342 -"D" : define symbol to have some value: *
343 -"Dsymbol" symbol gets the value 'define'
344 -"Dsymbol=value" symbol gets the value 'value'
345 -E : stop at the end of questions, after having produced config.sh. *
346 -K : do not use unless you know what you are doing.
347 -O : let -D and -U override definitions from loaded configuration file. *
348 -S : perform variable substitutions on all .SH files (can mix with -f) *
349 -"U" : undefine symbol: *
350 -"Usymbol" symbol gets the value 'undef'
351 -"Usymbol=" symbol gets completely empty
352 -V : print version number and exit (with a zero status).
353$ EOD
354$ echo "%Config-I-VMS, lower case switches must be enclosed"
355$ echo "-Config-I-VMS, in double quotation marks, e.g.:"
356$ echo "-Config-I-VMS, @Configure ""-des"""
357$ echo "-Config-I-VMS, * indicates switch may not be fully implemented for VMS."
358$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
359$ STOP
360$ EXIT 3 ! $STATUS = "%X00000003" (informational)
361$ ENDIF
362$!
363$ GOTO Check_silence
364$!
365$Shut_up:
366$ IF F$Mode() .eqs. "BATCH"
367$ THEN
368$ STDOUT = F$PARSE(F$GETQUI("DISPLAY_ENTRY", "JOB_NAME"), -
369 F$GETQUI("DISPLAY_ENTRY", "LOG_SPECIFICATION"), ".LOG")
370$ WRITE SYS$OUTPUT "Warning: Executing in batch mode. To avoid file locking conflicts,"
371$ WRITE SYS$OUTPUT "output intended for SYS$OUTPUT will be sent to a new version"
372$ WRITE SYS$OUTPUT STDOUT
373$ ELSE
374$ STDOUT = F$TRNLNM("SYS$OUTPUT")
375$ ENDIF
376$ DEFINE SYS$OUTPUT "_NLA0:"
377$ echo4 = "write STDOUT "
378$ cat4 = "TYPE/OUTPUT=''STDOUT'"
379$ open/write/share=read STDOUT 'STDOUT'
380$ RETURN
381$!
382$Check_silence:
383$ IF (silent)
384$ THEN
385$ GOSUB Shut_up
386$ ELSE
387$ echo4 = "write SYS$OUTPUT "
388$ cat4 = "TYPE"
389$ ENDIF
390$!
391$!: run the defines and the undefines, if any, but leave the file out there...
392$! Unfortunately Configure.COM in DCL is not yet set up to do this -
393$! maybe someday
394$!
395$!: set package name
396$ package = "perl5"
397$ packageup = F$EDIT((package - "5"),"UPCASE")
398$!
399$!: Eunice requires " " instead of "", can you believe it
400$ echo ""
401$!: Here we go...
402$ echo "Beginning of configuration questions for ''package'."
403$ echo ""
404$!
405$!: Some greps do not return status, grrr.
406$ contains = "SEARCH"
407$!
408$!: first determine how to suppress newline on echo command !cant DCL is record oriented
409$! echo "Checking ''echo' to see how to suppress newlines..."
410$! echo "giving up..."
411$! echo "The star should be here-->*"
412$!
413$!: Now test for existence of everything in MANIFEST
414$ echo ""
415$ echo4 "First let's make sure your kit is complete. Checking..."
416$ manifestfound = ""
417$ miss_list = ""
418$! Here I assume we are in the [foo.PERLxxx...] tree
419$! because the search routine simply does set def [-] if necessary.
420$ file_2_find = "MANIFEST" !I hope this one is not in [foo.PERL5xxx.VMS...]
421$Research_manifest:
422$ manifestfound = F$SEARCH(file_2_find)
423$ IF (manifestfound .EQS. "")
424$ THEN
425$ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
426$ THEN
427$ SET DEFAULT [-]
428$ GOTO Research_manifest
429$ ELSE
430$ echo ""
431$ echo "There is no MANIFEST file. I hope your kit is complete !"
432$ miss_list = ""
433$ GOTO Beyond_manifest
434$ ENDIF
435$ ELSE
436$! MANIFEST. has been found and we have set def'ed there.
437$! Time to bail out before it's too late, i.e. too deep.
438$! Depth check is unnecessary on Alpha VMS V7.2++ (even for ODS-2).
439$ tmp = f$extract(1,3,f$edit(f$getsyi("VERSION"),"TRIM,COLLAPSE"))
440$ IF (tmp .GES. "7.2") .AND. (F$GETSYI("HW_MODEL") .GE. 1024) THEN GOTO Beyond_depth_check
441$! Depth check also unnecessary on ODS 5 (or later) file systems.
442$ tmp = F$INTEGER(F$GETDVI(F$ENVIRONMENT("DEFAULT"),"ACPTYPE") - "F11V")
443$ IF (tmp .GE. 5) THEN GOTO Beyond_depth_check
444$ IF (F$ELEMENT(max_allowed_dir_depth,".",F$ENVIRONMENT("DEFAULT")).nes.".")
445$ THEN
446$ TYPE SYS$INPUT:
447$ DECK
448%Config-E-VMS, ERROR:
449 Sorry! It apears as though your perl build sub-directory is already too
450 deep into the VMS file system. Please try moving stuff into a shallower
451 directory (or altering the "max_allowed_dir_depth" parameter).
452$ EOD
453$ echo4 "ABORTING..."
454$ SET DEFAULT 'vms_default_directory_name' !be kind rewind
455$ STOP
456$ EXIT !2 !$STATUS = "%X00000002" (error)
457$ ENDIF
458$Beyond_depth_check:
459$!
460$! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
461$!
462$ IF (manifestfound .NES. "")
463$ THEN
464$ IF ( F$SEARCH("UU.DIR").EQS."" )
465$ THEN
466$ CREATE/DIRECTORY [.UU]
467$ ELSE
468$ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM [.UU]*.*;*
469$ ENDIF
470$!: Configure runs within the UU subdirectory
471$ SET DEFAULT [.UU]
472$!
473$! a little redundancy never hurt anybody?
474$ file_2_find = "[-]" + file_2_find
475$ manifestfound = F$SEARCH(file_2_find)
476$!
477$ OPEN/WRITE MISSING MISSING.
478$!change to "FALSE" if you wish to skip the manifest search
479$!(which after all is rather slow in DCL :-)
480$ IF (maniskip)
481$ THEN
482$ echo "Skipping MANIFEST check as requested"
483$ ELSE
484$!
485$ OPEN/READ CONFIG 'manifestfound'
486$Read_loop_manifest:
487$ READ/END_OF_FILE = Done_manifest CONFIG line
488$! This algorithm turns "foo/bar/baz.c" into "[.foo.bar]baz.c"
489$! [email protected] 10-JUN-1996 20:31:46
490$! 2-MAR-1998 15:46:11 Improved to turn "foo/bar/baz.c.buz"
491$! into "[.foo.bar]baz.c_buz as happens with vmstar and unzip
492$ line = F$EDIT(line,"TRIM, COMPRESS")
493$ file_2_find = F$EXTRACT(0,F$LOCATE(" ",line),line)
494$ IF F$LOCATE("/",file_2_find) .NE. F$LENGTH(file_2_find)
495$ THEN
496$Re_strip_line_manifest:
497$ loca = F$LOCATE("/",file_2_find)
498$ ante = F$EXTRACT(0,loca,file_2_find)
499$ post = F$EXTRACT(loca,F$LENGTH(file_2_find),file_2_find)
500$ test_this = ante + "." + (post - "/")
501$ IF F$LOCATE("/",test_this) .NE. F$LENGTH(test_this)
502$ THEN
503$ file_2_find = ante + "." + (post - "/")
504$ GOTO Re_strip_line_manifest
505$ ELSE
506$ file_2_find = ante + "]" + (post - "/")
507$ ENDIF
508$ file_2_find = "[-."+file_2_find