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
6 $! For example, if you unpacked perl into: [USER.PERL-5n...] then you will
7 $! want to cd into the tree and execute Configure:
9 $! $ SET DEFAULT [USER.PERL5_xxx]
14 $! $ SET DEFAULT [USER.PERL5_xxx]
15 $! $ @Configure "-des"
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 vmsperl@perl.org
21 $! ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23 $! send suggestions to:
24 $! Dan Sugalski <dan@sidhe.org>
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
35 $! VMS-isms we will need:
36 $ echo = "write sys$output "
38 $ delete := delete ! local symbol overrides globals with qualifiers
46 $ be_case_sensitive = "n"
47 $ shorten_long_symbols = "y"
48 $ unlink_all_versions = "n"
50 $ use_vmsdebug_perl = "n"
56 $ usesitecustomize = "n"
57 $ C_Compiler_Replace = "CC="
58 $ thread_upcalls = "MTU="
59 $ thread_kernel = "MTK="
60 $ use_two_pot_malloc = "N"
61 $ use_pack_malloc = "N"
62 $ use_debugmalloc = "N"
68 $ vms_default_directory_name = F$ENVIRONMENT("DEFAULT")
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]
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.
79 $! Now keep track of open files
81 $ vms_filcnt = F$GETJPI ("","FILCNT")
83 $!: compute my invocation name
84 $ me = F$ENVIRONMENT("PROCEDURE")
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"
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
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
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
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
125 $!libswanted="$libswanted dld ld sun m c cposix posix ndir dir crypt" !sfn
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
138 $!: set up default values
142 $ IF F$TYPE(config_sh) .EQS. "" THEN config_sh=""
153 $ use_5005_threads = "N"
159 $ THEN !one or more switches was thrown
166 $ config_args = config_args + F$FAO(" !AS",P'i')
169 $ IF (i.LT.9) THEN GOTO Param_loop !DCL allows P1..P8
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:
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")
183 $ gotopt = "t" !"rue"
185 $ gotshortopt = "t" !"rue"
187 $ IF (F$EXTRACT(0,1,P'i') .EQS. "e")
194 $ IF (F$EXTRACT(0,1,P'i') .EQS. "f") ! "-f"
198 $ IF (F$SEARCH(config_sh).NES."")
200 $ test_config_sh = F$FILE_ATTRIBUTES(config_sh,"PRO")
201 $ IF (F$LOCATE("R",test_config_sh).NE.F$LENGTH(test_config_sh))
204 $ CONTINUE !at this point check UIC && if test allows...
207 $ echo "''me': cannot read config file ''config_sh'."
211 $ echo "''me': cannot read config file ''config_sh'."
216 $ IF (F$EXTRACT(0,1,P'i') .EQS. "h") ! "-h"
223 $ IF (F$EXTRACT(0,1,P'i') .EQS. "m") ! "-m"
230 $ IF (F$EXTRACT(0,1,P'i') .EQS. "r") ! "-r"
237 $ IF (F$EXTRACT(0,1,P'i') .EQS. "s") ! "-s"
244 $ IF (F$EXTRACT(0,1,P'i') .EQS. "E") ! "-E"
249 $ IF (F$EXTRACT(0,1,P'i') .EQS. "K") ! "-K"
256 $ IF (F$EXTRACT(0,1,P'i') .EQS. "O") ! "-O"
263 $ IF (F$EXTRACT(0,1,P'i') .EQS. "S") ! "-S"
265 $ extractsh = "true" !VMS? Yes with munchconfig
270 $ IF (F$EXTRACT(0,1,P'i') .EQS. "D") ! "-D"
273 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
275 $ tmp = P'i' + "=""define"""
279 $ IF (F$LOCATE("=",P'i') .EQ. (F$LENGTH(P'i') - 1))
281 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
282 $ echo "''me': use ""-Usymbol=val"" not ""-Dsymbol=""."
283 $ echo "''me': ignoring -D",P'i'
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') + """"
293 $ IF (F$EXTRACT(0,1,P'i') .EQS. "U") ! "-U"
296 $ IF (F$LOCATE("=",P'i') .EQ. F$LENGTH(P'i'))
298 $ tmp = P'i' + "="""""
302 $ IF (F$LOCATE("=",P'i') .LT. (F$LENGTH(P'i') - 1))
304 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
305 $ echo "''me': use ""-Dsymbol=val"" not ""-Usymbol=val""."
306 $ echo "''me': ignoring -U",P'i'
308 $ tmp = P'i' + "=""undef"""
315 $ IF (F$EXTRACT(0,1,P'i') .EQS. "V")
317 $ me = F$PARSE(me,,,"NAME") + F$PARSE(me,,,"TYPE")
318 $ echo "''me' generated by an unknown version of EDT."
324 $ echo "''me': unknown option ",P'i'
327 $ IF (F$LENGTH(P'i').GT.0).AND.(gotshortopt) THEN i = i - 1 !clustered switch
329 $ IF (i .LT. (bang + 1)) THEN GOTO Opt_loop
331 $ ENDIF ! (P1 .NES. "")
332 $ config_args = F$EDIT(config_args,"TRIM")
336 $ me = F$PARSE(me,,,"DIRECTORY")+ F$PARSE(me,,,"NAME")
337 $ echo "Usage: @''me' [-dehmr""EKOSV""] [-fconfig.sh] [""-Dsymbol""] [""-Dsymbol=value""]"
338 $ echo " [-Usymbol] [-Usymbol=]"
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).
345 "-m" : skip the MANIFEST check to see that all files are present
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).
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
366 $ EXIT 3 ! $STATUS = "%X00000003" (informational)
372 $ IF F$Mode() .eqs. "BATCH"
374 $ x = F$GETQUI("CANCEL_OPERATION") ! clear the deck
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: "
382 $ WRITE SYS$OUTPUT STDOUT
384 $ DELETE_/SYMBOL bproc_queue
385 $ DELETE_/SYMBOL bproc_entry
386 $ DELETE_/SYMBOL bproc_name
387 $ DELETE_/SYMBOL bproc_log_spec
389 $ STDOUT = F$TRNLNM("SYS$OUTPUT")
391 $ DEFINE SYS$OUTPUT "_NLA0:"
392 $ echo4 = "write STDOUT "
393 $ cat4 = "TYPE/OUTPUT=''STDOUT'"
394 $ open/write/share=read STDOUT 'STDOUT'
402 $ echo4 = "write SYS$OUTPUT "
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 -
412 $ packageup = F$EDIT((package - "5"),"UPCASE")
414 $!: Eunice requires " " instead of "", can you believe it
417 $ echo "Beginning of configuration questions for ''package'."
420 $!: Some greps do not return status, grrr.
421 $ contains = "SEARCH"
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-->*"
428 $!: Now test for existence of everything in MANIFEST
430 $ echo4 "First let's make sure your kit is complete. Checking..."
433 $! Here I assume we are in the [foo.PERLxxx...] tree
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...]
437 $ manifestfound = F$SEARCH(file_2_find)
438 $ IF (manifestfound .EQS. "")
440 $ IF F$PARSE(F$ENVIRONMENT("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
443 $ GOTO Research_manifest
446 $ echo "There is no MANIFEST file. I hope your kit is complete !"
448 $ GOTO Beyond_manifest
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.".")
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).
468 $ echo4 "ABORTING..."
469 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
471 $ EXIT !2 !$STATUS = "%X00000002" (error)
475 $! after finding MANIFEST let's create (but not yet enter) the UU subdirectory
477 $ IF (manifestfound .NES. "")
479 $ IF ( F$SEARCH("UU.DIR").EQS."" )
481 $ CREATE/DIRECTORY [.UU]
483 $ IF ( F$SEARCH("[.UU.CXX_REPOSITORY]*.*").NES."" )
485 $ DELETE/NOLOG/NOCONFIRM [.UU.CXX_REPOSITORY]*.*;*
486 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) [.UU]CXX_REPOSITORY.DIR
488 $ IF ( F$SEARCH("[.UU]*.*").NES."" ) THEN DELETE/NOLOG/NOCONFIRM [.UU]*.*;*
490 $!: Configure runs within the UU subdirectory
493 $! a little redundancy never hurt anybody?
494 $ file_2_find = "[-]" + file_2_find
495 $ manifestfound = F$SEARCH(file_2_find)
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 :-)
502 $ echo "Skipping MANIFEST check as requested"
505 $ OPEN/READ CONFIG 'manifestfound'
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)
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)
523 $ file_2_find = ante + "." + (post - "/")
524 $ GOTO Re_strip_line_manifest
526 $ file_2_find = ante + "]" + (post - "/")
528 $ file_2_find = "[-."+file_2_find
530 $ file_2_find = "[-]" + file_2_find
533 $ tmp = F$PARSE(file_2_find + ";",,,,"SYNTAX_ONLY")
534 $ IF F$SEARCH(tmp) .NES. "" THEN file_2_find = tmp
535 $ dirname = F$EXTRACT(0,F$LOCATE("]",file_2_find),file_2_find) + "]"
536 $ file_2_find = file_2_find - dirname
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
544 $ dot_ele = F$ELEMENT(dots,".",file_2_find)
545 $ IF dot_ele .EQS. "." THEN GOTO Eo_dot_loop
547 $ THEN basename = f$extract(0,f$locate(".",file_2_find),file_2_find) + "."
548 $ ELSE basename = basename + dot_ele + "_"
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
558 $ found = F$SEARCH(file_2_find)
559 $ IF (found .EQS. "" .AND. dots .GT. 2)
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.
564 $ dotloc = f$locate(".",basename)
565 $ basename[dotloc,1] := "_"
566 $ dot_ele = F$ELEMENT(dots - 1,"_",f$extract(dotloc,f$length(basename),basename))
568 f$extract(0,f$length(basename)-(f$length(dot_ele)+1),basename) -
570 $ found = F$SEARCH(dirname + basename)
571 $ file_2_find = file_2_find + "," + basename
573 $ tildeloc = f$locate("~",basename)
574 $ IF (found .EQS. "" .AND. tildeloc .LT. f$length(basename))
576 $ basename[tildeloc,1] := "_"
577 $ found = F$SEARCH(dirname + basename)
578 $ file_2_find = file_2_find + "," + basename
580 $ IF (found .EQS. "")
582 $ WRITE MISSING file_2_find
583 $ IF ((F$LENGTH(miss_list)+F$LENGTH(file_2_find)).LT.250)
585 $ miss_list = miss_list + "," + file_2_find
588 $ GOTO Read_loop_manifest
593 $ ENDIF ! (manifestfound .NES. "")
595 $ IF (miss_list .NES. "")
597 $ echo "Some of the files not found include:"
600 $ IF ((miss_list .NES. "").OR.(manifestfound .EQS. ""))
606 THIS PACKAGE SEEMS TO BE INCOMPLETE.
608 You have the option of continuing the configuration process, despite the
609 distinct possibility that your kit is damaged, by typing 'y'es. If you
610 do, don't blame me if something goes wrong. I advise you to type 'n'o
611 and contact the author (dan@sidhe.org)
614 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
617 $ echo4 "Continuing..."
619 $ echo4 "ABORTING..."
623 $ echo4 "Looks good..."
624 $ DELETE/NOLOG/NOCONFIRM MISSING.;
625 $ ENDIF ! (miss_list .NES. "")
626 $ ENDIF ! (manifestfound .EQS. "") ELSE
628 $! after finding MANIFEST (see above)
629 $!: Configure runs within the UU subdirectory
631 $!: compute the number of columns on the terminal for proper question formatting
632 $ IF F$MODE() .EQS. "BATCH"
633 $! else it winds up being 512 in batch
635 $ ELSE COLUMNS = F$GETDVI("SYS$OUTPUT","DEVBUFSIZ")
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
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
646 $! The sub_rp splitting is intended to handle long symbols such as the dflt for
651 $ len_rp = F$LENGTH(rp)
652 $ If (.NOT. silent) Then echo ""
657 $ sub_rp = F$EXTRACT(i_rp,COLUMNS,rp)
658 $ i_rp = i_rp + COLUMNS
659 $ if i_rp .LT. len_rp THEN echo4 "''sub_rp'"
660 $ IF i_rp .LT. len_rp THEN GOTO rp_loop
668 $ READ SYS$COMMAND/PROMPT="''sub_rp'" ans
670 $ IF (ans .EQS. "&-d")
672 $ echo4 "(OK, I will run with -d after this question.)"
674 $ deferred_fastread =1
677 $ IF (ans .EQS. "&-s")
679 $ echo4 "(OK, I will run with -s after this question.)"
681 $ deferred_silent = 1
684 $ if (bool_dflt .nes. "")
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")
692 $ if (ans .eqs. "N" .or. ans .eqs. "0" .or. ans .eqs. "F")
696 $ echo4 "Input not understood please answer 'Yes' or 'No'"
702 $ ans = f$edit(ans,"trim,compress")
703 $ if (ans .eqs. "") then ans = dflt
704 $ if (f$edit(ans,"upcase") .eqs. "NONE") then ans = ""
706 $ if f$type(deferred_silent) .nes. ""
710 $ delete/symbol deferred_silent
712 $ if f$type(deferred_fastread) .nes. ""
715 $ delete/symbol deferred_fastread
721 $!: create .config dir to save info across Configure sessions
722 $ IF ( F$SEARCH("[-]CONFIG.DIR").EQS."" )
724 $ CREATE/DIRECTORY [-.CONFIG]
725 $ OPEN/WRITE CONFIG [-.CONFIG]README.
727 "This directory created by Configure to save information that should"
729 "persist across sessions."
732 "You may safely delete it if you wish."
736 $ IF F$TYPE(usedevel) .EQS. "" THEN usedevel := n
737 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
738 $ IF (patchlevel_h.NES."")
740 $ SEARCH 'patchlevel_h' "define","PERL_VERSION","epoch"/match=and/out=[]ver.out
741 $ IF .NOT. usedevel .AND. usedevel .NES. "define"
743 $ OPEN/READ CONFIG []ver.out
746 $ tmp = F$EDIT(line,"TRIM,COMPRESS")
747 $ xpatchlevel = F$INTEGER(F$ELEMENT(2," ",tmp))
748 $ line = xpatchlevel / 2
749 $ tmp = xpatchlevel - ( line * 2 )
752 $ echo4 "patchlevel is " + F$STRING(xpatchlevel)
755 *** WHOA THERE!!! ***
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.)
762 Do ***NOT*** install this into production use.
763 Data corruption and crashes are possible.
765 It is most seriously suggested that you do not continue any further
766 unless you want to help in developing and debugging Perl.
770 $ rp="Do you really want to continue? [''bool_dflt'] "
771 $ fastread_save = fastread
774 $ fastread = fastread_save
775 $ delete/symbol fastread_save
778 $ echo4 "Okay, continuing."
781 $ DELETE/NOLOG/NOCONFIRM []ver.out;
788 $ DELETE/NOLOG/NOCONFIRM []ver.out;
790 $!: general instructions
793 $ user = F$EDIT(F$GETJPI("","USERNAME"),"TRIM,COLLAPSE")
794 $ IF .NOT.(F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
796 $ messages = F$ENVIRONMENT("MESSAGE")
797 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
798 $ contains /NOOUTPUT [-.CONFIG]INSTRUCT. 'user'
799 $ IF .NOT.($status.EQ.%X08D78053)
803 $ rp = "Would you like to see the instructions? [''bool_dflt'] "
805 $ if .NOT.ans THEN needman=""
807 $ SET MESSAGE 'messages'
809 $ if (fastread.AND.silent.AND.(alldone.eqs."cont")) THEN needman=""
816 This installation shell script will examine your system and ask you questions
817 to determine how the perl5 package should be installed. If you get
818 stuck on a question, you may use a ^C or ^Y shell escape to STOP this
819 process, edit something, then restart this process as you just did.
820 Many of the questions will have default answers in square
821 brackets; typing carriage return will give you the default.
828 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
833 In a hurry? You may run '@Configure "-d"'. This will bypass nearly all
834 the questions and use the computed defaults (or the previous answers provided
835 there was already a config.sh file). Type '@Configure "-h"' for a list of
843 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
848 Much effort has been expended to ensure that this shell script will
849 run on any VMS system. If despite that it blows up on yours, your
850 best bet is to edit Configure.com and @ it again. Whatever problems
851 you have with Configure.com, let me (dan@sidhe.org) know how I blew
855 $!This installation script affects things in two ways:
857 $!1) it may do direct variable substitutions on some of the files included
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.
862 $!If you make a mistake on a question, there is no easy way to back up to it
869 $ READ SYS$COMMAND/PROMPT="Type carriage return to continue " ans
871 $ IF (F$SEARCH("[-.CONFIG]INSTRUCT.").EQS."")
873 $ OPEN/WRITE CONFIG [-.CONFIG]INSTRUCT.
877 $ ENDIF !(needman .EQS. "true")
879 $!: see if sh knows # comments !sfn
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"
883 $!trylist="byacc/cpp/csh/date/egrep/less/line/more/nroff/perl/pg/sendmail/test/uname"
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!"
887 $! echo "Don't worry if any of the following aren't found..."
888 $!: determine whether symbolic links are supported !sfn !jem- further down
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
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.
895 $ config_sh_es = "''config_sh'/[-]config.sh/"
899 $ config_sh = F$ELEMENT(i,"/",config_sh_es)
901 $ IF (config_sh.NES."/").AND.(config_sh.NES."")
903 $ configshfound = F$SEARCH(config_sh)
904 $ IF (configshfound.NES."") THEN GOTO Config_sh_found
906 $ IF (i.LT.max) THEN GOTO Config_sh_look
907 $ osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
908 $ IF (configshfound.EQS."")
910 $ config_sh = "[-]config.sh" ! the fallback default
911 $ GOTO Beyond_config_sh
914 $ IF F$TYPE(osname) .EQS. "" THEN osname = F$EDIT(F$GETSYI("NODE_SWTYPE"),"COLLAPSE")
916 $ IF F$TYPE(config_dflt) .NES. "" THEN bool_dflt = config_dflt
917 $ rp = "Shall I use ''config_sh' for default answers? [''bool_dflt'] "
922 $ echo "Fetching default answers from ''config_sh'..."
924 $! we do our own parsing of the shell-script stuff
925 $! ...and only accept symbols if they're in the | delimited list below
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|"
929 $ config_symbols2 ="|prefix|privlib|privlibexp|scriptdir|sitearch|sitearchexp|sitebin|sitelib|sitelib_stem|sitelibexp|usecxx|use64bitall|use64bitint|"
930 $ config_symbols3 ="|usecasesensitive|usedefaulttypes|usedevel|useieee|useithreads|uselongdouble|usemultiplicity|usemymalloc|usedebugging_perl|"
931 $ config_symbols4 ="|usesecurelog|usethreads|usevmsdebug|usefaststdio|usemallocwrap|unlink_all_versions|uselargefiles|usesitecustomize|"
932 $ config_symbols5 ="|buildmake|builder|usethreadupcalls|usekernelthreads|useshortenedsymbols|useversionedarchname"
934 $ open/read CONFIG 'config_sh'
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
944 $ syms = config_symbols'k'
945 $ j = f$locate(dsym, syms)
946 $ if j .lt. f$length(syms) then goto erd_ck_loop
948 $ if k .lt. 6 then goto rd_ck_loop
951 $ val = f$element(1,"=",line)
952 $ val = f$extract(1,f$length(val)-2,val)
953 $ write sys$output "''sym' = ""''val'"""
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
963 $ delete/symbol config_symbols5
967 $ if f$type(usedebugging_perl) .nes. ""
969 $ DEBUGGING = usedebugging_perl
970 $ delete/symbol usedebugging_perl
974 $ if f$type(config_dflt) .nes. "" then DELETE/SYMBOL config_dflt
976 $!we actually do not have "hints/" for VMS
980 $!First time through, eh? I have some defaults handy for the following systems:
983 $! echo " ","VMS_VAX"
984 $! echo " ","VMS_AXP"
985 $! echo " ","VMS_IA64"
986 $! : Now look for a hint file osname_osvers, unless one has been
987 $! : specified already.
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".
993 $! READ SYS$COMMAND/PROMPT="Which of these apply, if any? " ans
997 $!: Restore computed paths !sfn
999 $! %Config-I-VMS, a necessary error trap (could be PC running VCL)
1001 $ IF (osname .NES. "VMS")
1003 $ echo4 "Hmm.. I wonder what ''osname' is (?)"
1007 %Config-E-VMS, ERROR:
1009 Err, you do not appear to be running VMS!
1010 This procedure is intended to Configure the building of Perl for VMS.
1017 $ echo4 "Continuing..."
1019 $ echo4 "ABORTING..."
1020 $ SET DEFAULT 'vms_default_directory_name' !be kind rewind
1022 $ EXIT 2 !$STATUS = "%X00000002" (error)
1024 $ ENDIF !(osname .NES./.EQS. "VMS")
1026 $!: who configured the system
1027 $ cf_by = F$EDIT(user,"LOWERCASE")
1028 $ osvers = F$EDIT(F$GETSYI("VERSION"),"TRIM")
1030 $! Peter Prymmer has seen:
1031 $! "SYS$TIMEZONE_DIFFERENTIAL" = "-46800" (sic)
1032 $! "SYS$TIME_ZONE" = "EDT"
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"
1042 $! Charles Bailey recommends (in ANU NEWS Doc Jan 1995):
1044 $! "Multinet_Timezone"
1045 $! "TCPware_Timezone"
1048 $! This snippet o' DCL returns a string in default Unix `date` format,
1049 $! and it will prompt to set SYS$TIMEZONE_DIFFERENTIAL.
1051 $ MIN_TZO = -840 !units are minutes here
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")
1062 $ months = "/Jan/Feb/Mar/Apr/May/Jun/Jul/Aug/Sep/Oct/Nov/Dec/"
1066 $ mon = F$ELEMENT(i,"/",months)
1067 $ IF i.LT.monn THEN GOTO Mon_loop
1070 $ systz = F$TRNLNM("SYS$TIMEZONE_DIFFERENTIAL")
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
1078 $ THEN signothetime = "+"
1079 $ IF tzhour.EQ.0.AND.tzminrem.EQ.0
1080 $ THEN direction = "on GMT/"
1081 $ ELSE direction = "east of "
1083 $ ELSE signothetime = "-"
1084 $ tzhour = -1*tzhour !keeps !UL happy
1085 $ direction = "west of "
1088 $ echo "According to the setting of your ""SYS$TIMEZONE_DIFFERENTIAL"" (= ''systz')"
1091 $ tzspan = "''tzhour' hours & ''tzminrem' minutes"
1093 $ tzspan = "''tzhour' hours"
1096 $ echo "Your system is ''tzspan' ''direction'UTC in England."
1097 $ rp = "(''systz') Is this UTC Time Zone Offset correct? [''bool_dflt'] "
1103 $ GOTO Beyond_TimeZone
1107 $ echo4 """SYS$TIMEZONE_DIFFERENTIAL"" does not appear to be DEFINEd on your system"
1112 $ echo "Please tell me in hh:mm form what time offset from GMT/UTC in England"
1113 $ echo "you are. As an example Eastern (US) Standard Time is -5:00 offset, but"
1114 $ echo "Eastern Daylight Time (summer) is -4:00 offset."
1116 $ rp = "Enter the Time Zone offset: [''dflt'] "
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.""
1126 $ tzminrem = F$INTEGER(tzminrem)
1127 $ IF F$EXTRACT(0,1,"''ans'") .EQS. "-" THEN tzminrem = tzminrem * -1
1131 $ tzmins = tzhour*60 + tzminrem
1132 $ tzd = F$STRING(tzmins*60)
1135 $ signothetime = "+"
1137 $ tzhour = -1*tzhour !keeps !UL happy
1138 $ signothetime = "-"
1140 $ IF (tzmins.GT.MAX_TZO).OR.(tzmins.LT.MIN_TZO)
1143 $ echo "%Config-W-VMS-TIMERANGE, Response must be in the range -14:00 to 14:00."
1148 $ tz = f$fao("UTC!AS!UL:!2ZL",signothetime,tzhour,tzminrem)
1149 $ cf_time = "''wkday' ''mon' ''mday' ''hour':''min':''sec' ''tz' ''year'"
1151 $! This quotation from Configure has to be included on VMS:
1156 There is, however, a strange, musty smell in the air that reminds me of
1157 something...hmm...yes...I've got it...there's a VMS nearby, or I'm a Blit.
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
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.
1168 $! configure a VAX build on an Alpha).
1170 $ IF (F$GETSYI("HW_MODEL") .LT. 1024 .AND. F$GETSYI("HW_MODEL") .GT. 0)
1172 $ archname = "VMS_VAX"
1173 $ otherarch = "an Alpha or IA64"
1175 $ arch_type = "ARCH-TYPE=__VAX__"
1177 $ IF (F$GETSYI("ARCH_TYPE") .EQ. 2)
1179 $ archname = "VMS_AXP"
1180 $ otherarch = "a VAX or IA64"
1181 $ arch_type = "ARCH-TYPE=__AXP__"
1183 $ archname = "VMS_IA64"
1184 $ otherarch = "a VAX or Alpha"
1185 $ arch_type = "ARCH-TYPE=__IA64__"
1190 $!: set the base revision
1192 $ revision = baserev - ".0"
1193 $!: get the patchlevel
1195 $ echo4 "Getting the current patchlevel..."
1200 $ api_subversion="0"
1201 $ perl_patchlevel="0"
1202 $ patchlevel_h = F$SEARCH("[-]patchlevel.h")
1203 $ IF (patchlevel_h.NES."")
1205 $ got_patch = "false"
1207 $ got_api_revision = "false"
1208 $ got_api_version = "false"
1209 $ got_api_subversion = "false"
1210 $ got_perl_patchlevel= "false"
1211 $ OPEN/READONLY CONFIG 'patchlevel_h'
1213 $ READ/END_Of_File=Close_patch/ERROR=Close_patch CONFIG line
1214 $ IF ((F$LOCATE("#define PERL_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_patch))
1216 $ line = F$EDIT(line,"COMPRESS, TRIM")
1217 $ patchlevel = F$ELEMENT(2," ",line)
1218 $ got_patch = "true"
1220 $ IF ((F$LOCATE("#define PERL_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_sub))
1222 $ line = F$EDIT(line,"COMPRESS, TRIM")
1223 $ subversion = F$ELEMENT(2," ",line)
1226 $ IF ((F$LOCATE("#define PERL_API_REVISION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_revision))
1228 $ line = F$EDIT(line,"COMPRESS, TRIM")
1229 $ api_revision = F$ELEMENT(2," ",line)
1230 $ got_api_revision = "true"
1232 $ IF ((F$LOCATE("#define PERL_API_VERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_version))
1234 $ line = F$EDIT(line,"COMPRESS, TRIM")
1235 $ api_version = F$ELEMENT(2," ",line)
1236 $ got_api_version = "true"
1238 $ IF ((F$LOCATE("#define PERL_API_SUBVERSION",line).NE.F$LENGTH(line)).AND.(.NOT.got_api_subversion))
1240 $ line = F$EDIT(line,"COMPRESS, TRIM")
1241 $ api_subversion = F$ELEMENT(2," ",line)
1242 $ got_api_subversion = "true"
1244 $ IF ((F$LOCATE("""DEVEL",line).NE.F$LENGTH(line)).AND.(.NOT.got_perl_patchlevel))
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"
1251 $ IF ((F$LOCATE("""SMOKE",line).NE.F$LENGTH(line)).AND.(.NOT.got_perl_patchlevel))
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"
1258 $ IF ((F$LOCATE("""MAINT",line).NE.F$LENGTH(line)).AND.(.NOT.got_perl_patchlevel))
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"
1265 $ IF (.NOT. got_patch) .OR. -
1266 (.NOT. got_sub) .OR. -
1267 (.NOT. got_api_revision) .OR. -
1268 (.NOT. got_api_version) .OR. -
1269 (.NOT. got_api_subversion) .OR. -
1270 (.NOT. got_perl_patchlevel) -
1271 THEN GOTO Patchlevel_h_loop
1276 $ IF F$SEARCH("[-].patch") .NES. ""
1279 $ OPEN/READ PATCH [-].patch
1282 $ tmp = F$EDIT(line,"TRIM,COMPRESS")
1283 $ IF F$ELEMENT(3, " ", tmp) .NES. "" THEN tmp = F$ELEMENT(3, " ", tmp)
1285 $ IF tmp .NES. "" THEN perl_patchlevel = tmp
1288 $ version_patchlevel_string = "version ''patchlevel' subversion ''subversion'"
1289 $ IF got_perl_patchlevel .AND. perl_patchlevel .NES. "0"
1291 $ version_patchlevel_string = "''version_patchlevel_string' patch ''perl_patchlevel'"
1293 $ echo "(You have ''package' ''version_patchlevel_string'.)"
1295 $ version = revision + "_" + patchlevel + "_" + subversion
1297 $!: see if we need a special compiler
1298 $! cc_list = "cc/decc|gcc" !%Config-I-VMS, compiler symbols/commands
1302 $ vms_cc_available = ""
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);"
1320 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
1321 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
1322 $ cc/NoObj/list=ccvms.lis ccvms.c
1325 $ IF (silent) THEN GOSUB Shut_up
1326 $ IF tmp.NE.%X10B90001
1328 $ IF tmp.NE.%X10000001
1330 $ nocc = "t" !%X10000001 is return from gcc
1331 $ GOTO Gcc_initial_check
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)
1342 $ echo "Will try cc/decc..."
1345 $ DEFINE/USER_MODE SYS$ERROR NL:
1346 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1347 $ cc/decc/NoObj/list=ccvms.lis ccvms.c
1350 $ IF (silent) THEN GOSUB Shut_up
1351 $ IF tmp.NE.%X10B90001
1353 $ echo "Apparently you don't have that one."
1356 $ echo "You also have: ''line' ''archsufx' ''F$GETSYI("VERSION")'"
1357 $ vms_cc_available = vms_cc_available + "cc/decc "
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))
1363 $ vms_cc_dflt = "/decc"
1364 $ vms_cc_available = vms_cc_available + "cc/decc "
1369 $ echo "Checking for gcc"
1370 $ OPEN/WRITE CONFIG gccvers.lis
1372 $ DEFINE/USER_MODE SYS$ERROR CONFIG
1373 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1374 $ 'gcc_symbol'/noobj/version _nla0:
1377 $ IF (silent) THEN GOSUB Shut_up
1379 $ IF (tmp.NE.%X10000001).and.(tmp.ne.%X00030001)
1381 $ echo "Symbol ""''gcc_symbol'"" is not defined. I guess you do not have it."
1382 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1383 $ GOTO Cxx_initial_check
1385 $ OPEN/READ CONFIG gccvers.lis
1387 $ READ/END_OF_FILE=GCC_List_End CONFIG line
1388 $ GOTO GCC_List_Read
1392 $ vms_cc_available = vms_cc_available + "''gcc_symbol' "
1393 $ DELETE/NOLOG/NOCONFIRM gccvers.lis;
1397 $! In order to build with the HP C++ compiler, invoke configure.com with "-Dusecxx" on
1398 $! the command line.
1400 $ IF F$TYPE(usecxx) .EQS. "" THEN usecxx := n
1401 $ IF usecxx .OR. usecxx .EQS. "define"
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);"
1418 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1419 $ DEFINE/USER_MODE SYS$ERROR NL:
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
1432 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1433 $ DEFINE/USER_MODE SYS$ERROR NL:
1434 $ link/nodebug ccvms.obj
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
1442 $ ld_try = "Link/nodebug"
1443 $ vms_cc_available = vms_cc_available + "cxx "
1444 $ echo "CXX and LINK are available."
1446 $ IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1448 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1449 $ DEFINE/USER_MODE SYS$ERROR NL:
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
1458 $ ld_try = "cxxlink"
1459 $ vms_cc_available = vms_cc_available + "cxx "
1460 $ echo "CXX and CXXLINK are available."
1463 $ IF F$SEARCH("ccvms.exe") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.exe;
1467 $ DELETE/NOLOG/NOCONFIRM ccvms.c;
1468 $ IF F$SEARCH("ccvms.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM ccvms.obj;
1469 $ CALL Cxx_demangler_cleanup
1471 $ ENDIF ! 1 .eq. 0 or 1 .eq. 1
1474 $ DELETE/NOLOG/NOCONFIRM ccvms.*;
1476 $!: see if we need a special compiler
1478 $ echo "Available compiler(s):"
1479 $ echo "( ''vms_cc_available')"
1482 $ IF usecxx .OR. usecxx .EQS. "define"
1486 $ dflt = "cc''vms_cc_dflt'" !-> "cc" in case first compile went OK
1491 $ rp = "Use which C compiler? [''dflt'] "
1495 $ ans = F$EDIT(ans,"TRIM, COMPRESS, LOWERCASE")
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))
1503 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1505 $ IF F$LOCATE("cxx",F$EDIT(ans,"COLLAPSE,LOWERCASE")) .NE. F$LENGTH(ans)
1510 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1514 $ IF F$LOCATE("dec",dflt) .NE. F$LENGTH(dflt) .or. -
1515 F$LOCATE("compaq",dflt) .NE. F$LENGTH(dflt)
1517 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1522 $ IF Mcc .EQS. "cc/decc"
1525 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1531 $ IF Mcc .EQS. "cc/decc"
1534 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1536 $ IF Mcc .EQS. "gcc"
1539 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1542 $Decc_Version_check:
1544 $ IF ccname .EQS. "DEC"
1547 $ echo4 "Checking for the Dec C version number..."
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);"
1563 $ DEFINE/USER_MODE SYS$ERROR NL:
1564 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1567 $ IF (silent) THEN GOSUB Shut_up
1568 $ DEFINE/USER_MODE SYS$ERROR NL:
1569 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1570 $ link/nodebug deccvers.obj
1572 $ IF (silent) THEN GOSUB Shut_up
1573 $ OPEN/WRITE CONFIG deccvers.out
1574 $ DEFINE/USER_MODE SYS$ERROR CONFIG
1575 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1576 $ mcr []deccvers.exe
1580 $ IF (silent) THEN GOSUB Shut_up
1581 $ OPEN/READ CONFIG deccvers.out
1582 $ READ/END_OF_FILE=Dec_c_cleanup CONFIG line
1585 $ echo "You are using Dec C ''line'"
1587 $ Dec_C_Version = F$INTEGER(line)
1588 $ IF Dec_C_Version .GE. 60200000 .AND. F$ELEMENT(0, "-", archname) .NES. "VMS_VAX"
1590 $ echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
1591 $ ccflags = ccflags + "/NOANSI_ALIAS"
1593 $ DELETE/NOLOG/NOCONFIRM deccvers.*;
1597 $ IF ccname .EQS. "GCC"
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. ""
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")
1610 $ IF gcclib_olb .EQS. ""
1611 $ THEN gcclib_olb = tmp
1612 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1615 $ tmp = F$SEARCH("SYS$LIBRARY:VAXCRTL.OLB")
1618 $ IF gcclib_olb .EQS. ""
1619 $ THEN gcclib_olb = tmp
1620 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1623 $ tmp = F$SEARCH("GNU_CC:[000000]crt0.obj")
1626 $ IF gcclib_olb .EQS. ""
1627 $ THEN gcclib_olb = tmp
1628 $ ELSE gcclib_olb = gcclib_olb + "/lib," + tmp
1631 $ IF gcclib_olb .EQS. vaxcrtl_olb THEN gcclib_olb = "" !goofy order of axplibs
1633 $ gcclib_olb = gcclib_olb + "/lib"
1635 $ IF gcclib_olb .NES. "" .AND. -
1636 (vaxcrtl_olb .NES. "" .OR. -
1637 vaxcrtl_exe .NES. "" )
1640 $ echo4 "Checking for GNU cc in disguise and/or its version number..." !>&4
1641 $ OPEN/WRITE CONFIG gccvers.c
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);"
1654 $ DEFINE SYS$ERROR _NLA0:
1655 $ DEFINE SYS$OUTPUT _NLA0:
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. ""
1665 $ IF F$LOCATE("VAXCRTL",gcclib_olb).NE.F$LENGTH(gcclib_olb)
1667 $ link/nodebug gccvers.obj,'gcclib_olb',SYS$LIBRARY:VAXCRTL/Library
1670 $ link/nodebug gccvers.obj,'gcclib_olb'
1674 $ OPEN/WRITE CONFIG GCCVERS.OPT
1675 $ WRITE CONFIG "SYS$SHARE:VAXCRTL/SHARE"
1677 $ link/nodebug gccvers.obj,GCCVERS.OPT/OPT,'gcclib_olb'
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
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
1696 $ DELETE/NOLOG/NOCONFIRM gccvers.*;
1697 $ IF F$LOCATE("GNU C version ",line).NE.F$LENGTH(line)
1699 $ echo "You are not using GNU cc."
1702 $ echo "You are using GNU cc ''line'"
1705 $ C_COMPILER_Replace = "CC=cc=''Mcc'"
1711 $ IF ccname .EQS. "CXX"
1713 $ OPEN/WRITE CONFIG cxxvers.c
1714 $ WRITE CONFIG "#include <stdio.h>"
1715 $ WRITE CONFIG "int main() {"
1716 $ WRITE CONFIG "#ifdef __DECCXX_VER"
1717 $ WRITE CONFIG " printf(""%i\n"", __DECCXX_VER);"
1718 $ WRITE CONFIG "#else"
1719 $ WRITE CONFIG " printf(""%i\n"", ""0"");"
1720 $ WRITE CONFIG "#endif"
1721 $ WRITE CONFIG " return(0);"
1725 $ DEFINE/USER_MODE SYS$ERROR NL:
1726 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1730 $ IF (silent) THEN GOSUB Shut_up
1732 $ DEFINE/USER_MODE SYS$ERROR NL:
1733 $ DEFINE/USER_MODE SYS$OUTPUT NL:
1737 $ IF (silent) THEN GOSUB Shut_up
1738 $ OPEN/WRITE CONFIG cxxvers.out
1740 $ DEFINE/USER_MODE SYS$ERROR CONFIG
1741 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
1746 $ IF (silent) THEN GOSUB Shut_up
1747 $ OPEN/READ CONFIG cxxvers.out
1748 $ READ/END_OF_FILE=Cxx_cleanup CONFIG line
1751 $ DELETE/NOLOG/NOCONFIRM cxxvers.*;
1752 $ echo "You are using CXX ''line'"
1755 $ d_cplusplus = "define"
1756 $ echo4 "adding /NOANSI_ALIAS qualifier to ccflags."
1757 $ ccflags = ccflags + "/NOANSI_ALIAS"
1758 $ CALL Cxx_demangler_cleanup
1760 $ d_cplusplus = "undef"
1763 $Cxx_demangler_cleanup: SUBROUTINE
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.
1770 $ IF F$SEARCH("[.CXX_REPOSITORY]*.*") .NES. "" THEN DELETE/NOLOG/NOCONFIRM [.CXX_REPOSITORY]*.*;*
1771 $ IF F$SEARCH("CXX_REPOSITORY.DIR") .NES. ""
1773 $ SET PROTECTION=(SYSTEM:RWED,OWNER:RWED) CXX_REPOSITORY.DIR
1774 $ DELETE/NOLOG/NOCONFIRM CXX_REPOSITORY.DIR;
1778 $ ENDSUBROUTINE ! Cxx_demangler_cleanup
1783 $ OPEN/READ CONFIG ccvms.lis
1785 $ IF F$ELEMENT(0, "-", archname) .EQS. "VMS_VAX"
1790 $ IF F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP"
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 "
1804 $ line = F$EDIT(line,"TRIM") !bit redundant but we're in no big hurry
1805 $ DELETE/NOLOG/NOCONFIRM ccvms.lis;
1809 $!: What should the include directory be ? (.TLB text libraries)
1811 $ rp = "Where are the include files you want to use? "
1812 $ IF f$length( rp + "[''dflt'] " ) .GT. 76
1813 $ THEN rp = F$FAO("!AS!/!AS",rp,"[''dflt'] ")
1814 $ ELSE rp = rp + "[''dflt'] "
1819 $!: see if we have to deal with yellow pages, now NIS.
1820 $!: now get the host name
1823 $ echo4 "Figuring out host name..." !>&4
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")
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")
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
1843 $ rp = "Your host name appears to be """"''myhostname'"""". Right? "
1848 $ READ SYS$COMMAND/PROMPT= -
1849 "Please type the (one word) name of your host: " ans
1852 $!: translate upper to lower if necessary
1853 $ myhostname = F$EDIT(myhostname,"COLLAPSE")
1854 $ mylowhostname = F$EDIT(myhostname," LOWERCASE")
1855 $ IF mylowhostname.NES.myhostname
1857 $ echo "(Normalizing case in your host name)"
1858 $ myhostname = mylowhostname
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::"
1865 $ rp = "What is your domain name? [''mydomain'] "
1869 $!: translate upper to lower if necessary
1870 $ mydomain = F$EDIT(mydomain,"COLLAPSE")
1871 $ mylowdomain = F$EDIT(mydomain," LOWERCASE")
1872 $ IF mylowdomain.NES.mydomain
1874 $ echo "(Normalizing case in your domain name)"
1875 $ mydomain = mylowdomain
1878 $ myhostname = myhostname - mydomain
1879 $ echo "(Trimming domain name from host name--host name is now ''myhostname')"
1885 I need to get your e-mail address in Internet format if possible, i.e.
1886 something like user@host.domain. Please answer accurately since I have
1887 no easy means to double check it. The default value provided below
1888 is most probably close to the reality but may not be valid from outside
1889 your organization...
1892 $ IF F$TYPE(cf_email) .EQS. ""
1894 $ dflt = "''cf_by'@''myhostname'"+"''mydomain'"
1895 $ rp = "What is your e-mail address? [''dflt'] "
1905 If you or somebody else will be maintaining perl at your site, please
1906 fill in the correct e-mail address here so that they may be contacted
1907 if necessary. Currently, the "perlbug" program included with perl
1908 will send mail to this address in addition to perlbug@perl.com. You may
1909 enter "none" for no administrator.
1912 $ dflt = "''cf_email'"
1913 $ rp = "Perl administrator e-mail address [''dflt'] "
1917 $!: determine where public executable scripts go
1918 $!: determine perl absolute location
1919 $!: figure out how to guarantee perl startup
1921 $!: see how we invoke the C preprocessor
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.
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
1939 $!: see if we have sigaction or sigprocmask
1940 $ IF (ccname .EQS. "DEC" .AND. Dec_C_Version .GE. 50200000) .OR. (ccname .EQS. "CXX")
1942 $ Has_Dec_C_Sockets = "T"
1944 $ echo4 "Hmm... Looks like you have Dec C Berkeley networking support."
1946 $ Has_Dec_C_Sockets = "F"
1949 $ IF Has_Dec_C_Sockets
1952 $ echo "You have sockets available via the C library. Should socket support"
1953 $ echo "be built into Perl?"
1955 $ rp = "Choose socket support option (NONE"
1956 $ IF Has_Dec_C_Sockets THEN rp = rp + ",DECC"
1957 $ rp = rp + ") [''dflt'] "
1959 $ Has_Dec_C_Sockets = "F"
1960 $ Has_socketshr = "F"
1961 $ ans = F$EDIT(ans,"TRIM,COMPRESS,LOWERCASE")
1962 $ IF ans.eqs."decc" THEN Has_Dec_C_Sockets = "T"
1966 $! Ask if they want to build with VMS_DEBUG perl
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."
1973 $ if f$type(usevmsdebug) .nes. ""
1975 $ if usevmsdebug .or. usevmsdebug .eqs. "define" then bool_dflt="y"
1977 $ rp = "Build a VMS-DEBUG version of Perl? [''bool_dflt'] "
1979 $ use_vmsdebug_perl = ans
1980 $ IF use_vmsdebug_perl
1982 $ usevmsdebug = "define"
1984 $ usevmsdebug = "undef"
1987 $! Ask if they want to build with DEBUGGING
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."
1995 $ if f$type(DEBUGGING) .nes. ""
1997 $ if f$extract(0,1,f$edit(DEBUGGING,"collapse,upcase")).eqs."Y" .or. DEBUGGING .eqs. "define" then bool_dflt="y"
1999 $ rp = "Build a DEBUGGING version of Perl? [''bool_dflt'] "
2001 $ use_debugging_perl = ans
2004 $! Ask about threads, if appropriate
2005 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
2008 $ echo "Perl can be built to offer a form of threading support on some systems."
2009 $ echo "To do so, configure.com can be run with -""Dusethreads""."
2011 $ echo "Note that Perl built with threading support runs slightly slower"
2012 $ echo "and uses slightly more memory than plain Perl."
2015 $ if f$type(usethreads) .nes. ""
2017 $ if usethreads .or. usethreads .eqs. "define" then bool_dflt="y"
2019 $! Catch cases where user specified ithreads but
2020 $! forgot -Dusethreads
2021 $ if f$type(useithreads) .nes. ""
2023 $ if useithreads .or. useithreads .eqs. "define" then bool_dflt="y"
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'] "
2030 $ usethreads = "define"
2033 $ if f$type(useithreads) .nes. ""
2035 $ if useithreads .eqs. "undef" then bool_dflt="n"
2037 $ if f$type(use5005threads) .nes. ""
2039 $ if use5005threads .or. use5005threads .eqs. "define"
2041 $ echo "5.005 threads are no longer supported"
2045 $ rp = "Use the newer interpreter-based ithreads? [''bool_dflt'] "
2048 $ use_5005_threads="N"
2049 $ ! Are they on VMS 7.1 or greater?
2050 $ IF "''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.1"
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."
2058 $ IF f$type(usethreadupcalls) .NES. ""
2060 $ if .not. usethreadupcalls .or. usethreadupcalls .eqs. "undef" then bool_dflt="n"
2062 $ rp = "Enable thread upcalls? [''bool_dflt'] "
2066 $ thread_upcalls = "MTU=MTU=1"
2067 $ usethreadupcalls = "define"
2068 $ ! Are they on alpha or itanium?
2069 $ IF (F$ELEMENT(0, "-", archname) .NES. "VMS_VAX") .AND. ("''f$extract(1,3, f$getsyi(""version""))'" .GES. "7.2")
2072 $ echo "Threaded Perl can be linked to use multiple kernel threads on your system."
2073 $ echo "This feature allows multiple user threads to make use of multiple CPUs on"
2074 $ echo "a multi-processor machine."
2076 $ IF f$type(usekernelthreads) .nes. ""
2078 $ if usekernelthreads .or. usekernelthreads .eqs. "define" then bool_dflt="y"
2080 $ rp = "Enable multiple kernel threads? [''bool_dflt'] "
2084 $ thread_kernel = "MTK=MTK=1"
2085 $ usekernelthreads = "define"
2091 $ usethreads = "undef"
2094 $ IF F$TYPE(usethreadupcalls) .EQS. "" THEN usethreadupcalls = "undef"
2095 $ IF F$TYPE(usekernelthreads) .EQS. "" THEN usekernelthreads = "undef"
2097 $! Ask if they want to build with MULTIPLICITY
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"
2103 $ echo "This multiple interpreter support is required for interpreter-based threads."
2104 $ usemultiplicity="define"
2107 $ if f$type(usemultiplicity) .nes. ""
2109 $ if usemultiplicity .or. usemultiplicity .eqs. "define" then bool_dflt = "y"
2111 $ rp = "Build Perl for multiplicity? [''bool_dflt'] "
2115 $ usemultiplicity="define"
2117 $ usemultiplicity="undef"
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")
2125 $ IF F$TYPE(use64bitint) .NES. ""
2127 $ IF use64bitint .OR. use64bitint .eqs. "define" THEN bool_dflt = "y"
2130 $ echo "You have natively 64-bit long integers."
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."
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'] "
2142 $ IF F$TYPE(use64bitall) .NES. ""
2144 $ IF use64bitall .OR. use64bitall .eqs. "define" THEN bool_dflt = "y"
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."
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'] "
2156 $ IF use64bitall .AND. .NOT. use64bitint
2159 $ echo "Since you have chosen a maximally 64-bit build, I'm also turning on"
2160 $ echo "the use of 64-bit integers."
2164 $ bool_dflt = use64bitall
2165 $ IF F$TYPE(uselargefiles) .NES. ""
2167 $ IF uselargefiles .OR. uselargefiles .eqs. "define" THEN bool_dflt = "y"
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."
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'] "
2179 $ IF F$TYPE(uselongdouble) .NES. ""
2181 $ IF uselongdouble .OR. uselongdouble .eqs. "define" THEN bool_dflt = "y"
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."
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'] "
2190 $ uselongdouble = ans
2192 $ ENDIF ! not VAX && >= 7.1
2194 $ IF usesitecustomize .OR. usesitecustomize .eqs. "define"
2196 $ usesitecustomize = "define"
2198 $ usesitecustomize = "undef"
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."
2211 $ echo "If you have no idea what this means, and do not have"
2212 $ echo "any program requiring anything, choose the default."
2213 $ bool_dflt = be_case_sensitive
2214 $ if f$type(usecasesensitive) .nes. ""
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"
2219 $ rp = "Build with case-sensitive symbols? [''bool_dflt'] "
2221 $ be_case_sensitive = ans
2223 $! Shortened symbols?
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. ""
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"
2233 $ rp = "Build with long symbols shortened? [''bool_dflt'] "
2235 $ shorten_long_symbols = ans
2236 $ IF F$ELEMENT(0, "-", archname) .NES. "VMS_VAX"
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"
2242 $ echo "with an external library or existing data, you may wish to disable"
2243 $ echo "the IEEE math option."
2244 $ bool_dflt = use_ieee_math
2245 $ if f$type(useieee) .nes. ""
2247 $ if useieee .or. useieee .eqs. "define"
2254 $ rp = "Use IEEE math? [''bool_dflt'] "
2256 $ use_ieee_math = ans
2258 $ use_ieee_math = "n"
2261 $ usecasesensitive = "undef"
2262 $ useshortenedsymbols = "undef"
2263 $ if (use_ieee_math) then useieee = "define"
2264 $ if (be_case_sensitive) then usecasesensitive = "define"
2265 $ if (shorten_long_symbols) then useshortenedsymbols = "define"
2266 $! Unlink all versions?
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. ""
2274 $ if unlink_all_versions .or. unlink_all_versions .eqs. "define"
2281 $ rp = "Make unlink() delete all versions of a file? [''bool_dflt'] "
2283 $ unlink_all_versions = ans
2284 $ IF unlink_all_versions
2286 $ d_unlink_all_versions = "define"
2288 $ d_unlink_all_versions = "undef"
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."
2297 $ echo "To use no flags, specify the word ""none""."
2298 $ dflt = user_c_flags
2299 $ rp = "Any additional cc flags? [''dflt'] "
2301 $ IF ans .EQS. "none" THEN ans = ""
2302 $ user_c_flags = "''ans'"
2304 $! Ask whether they want to use secure logical translation when tainting
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."
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."
2320 $ if f$type(usesecurelog) .nes. ""
2322 $ if f$extract(0,1,f$edit(usesecurelog,"collapse,upcase")).eqs."N" .or. usesecurelog .eqs. "undef" then bool_dflt = "n"
2324 $ rp = "Use secure logical name translation? [''bool_dflt'] "
2326 $ d_secintgenv = ans
2327 $ usesecurelog = "undef"
2328 $ if (d_secintgenv) then usesecurelog = "define"
2330 $! Ask whether they want to default filetypes
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)."
2340 $ echo "This is currently broken in some configurations. Only enable it if"
2341 $ echo "you know what you are doing."
2343 $ if f$type(usedefaulttypes) .nes. ""
2345 $ if usedefaulttypes .or. usedefaulttypes .eqs. "define" then bool_dflt="y"
2347 $ rp = "Always use default file types? [''bool_dflt'] "
2349 $ d_alwdeftype = ans
2350 $ usedefaulttypes = "undef"
2351 $ if (d_alwdeftype) then usedefaulttypes = "define"
2354 $ rp = "What is your architecture name? [''archname'] "
2358 $ ans = F$EDIT(ans,"COLLAPSE, UPCASE")
2359 $ IF (ans.NES.archname) !.AND.knowitall
2361 $ echo4 "I'll go with ''archname' anyway..."
2366 $ if f$type(useversionedarchname) .nes. ""
2368 $ if useversionedarchname .or. useversionedarchname .eqs. "define" then bool_dflt = "y"
2370 $ rp = "Add the Perl API version to your archname? [''bool_dflt'] "
2374 $ useversionedarchname = "define"
2375 $ IF F$LOCATE("-''version'", archname) .EQ. F$LENGTH(archname)
2377 $ archname = "''archname'-''version'"
2378 $ echo4 "...setting architecture name to ''archname'."
2380 $ echo4 "...and architecture name already has -''version'."
2383 $ useversionedarchname = "undef"
2386 $ IF usethreads .OR. usethreads .EQS. "define"
2388 $ echo4 "Threads selected."
2389 $ IF F$LOCATE("-thread", archname) .EQ. F$LENGTH(archname)
2391 $ archname = "''archname'-thread"
2392 $ echo4 "...setting architecture name to ''archname'."
2394 $ echo4 "...and architecture name already has -thread."
2398 $ IF usemultiplicity .OR. usemultiplicity .EQS. "define"
2400 $ echo4 "Multiplicity selected."
2401 $ IF F$LOCATE("-multi", archname) .EQ. F$LENGTH(archname)
2403 $ archname = "''archname'-multi"
2404 $ echo4 "...setting architecture name to ''archname'."
2406 $ echo4 "...and architecture name already has -multi."
2410 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
2412 $ echo4 "Long doubles selected."
2413 $ IF F$LOCATE("-ld", archname) .EQ. F$LENGTH(archname)
2415 $ archname = "''archname'-ld"
2416 $ echo4 "...setting architecture name to ''archname'."
2418 $ echo4 "...and architecture name already has -ld."
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'] "
2432 $ IF (F$ELEMENT(0, "-", archname).EQS."VMS_AXP")
2434 $ macros = macros + """AXE=1"","
2436 $ IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
2438 $ macros = macros + """IXE=1"","
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
2448 $ IF F$TYPE(prefix) .EQS. ""
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.]"
2456 $ ! more redundant scrubbing of values
2457 $ prefix = prefix - "000000."
2458 $ IF F$LOCATE(".]",prefix) .EQ. F$LENGTH(prefix) THEN prefix = prefix - "]" + ".]"
2460 $!: determine root of directory hierarchy where package will be installed.
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."
2471 $ rp = "Installation prefix to use (for ''vms_prefixup')? [ ''dflt' ] "
2476 $ IF F$LOCATE(".]",ans) .EQ. F$LENGTH(ans) THEN prefix = prefix - "]" + ".]"
2480 $ perl_root = prefix
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.
2487 $ tmp = perl_root - ".]" + "]"
2488 $ dflt = f$parse(tmp,,,,)
2491 $ echo4 "''tmp' does not yet exist."
2492 $! create/directory 'tmp'
2494 $ echo4 "''tmp' already exists."
2497 $ vms_skip_install = "true"
2500 $ rp = "Skip the remaining """"where install"""" questions? [''bool_dflt'] "
2502 $ IF (.NOT.ans) THEN vms_skip_install = "false"
2503 $ IF (.NOT.vms_skip_install)
2506 $!: set the prefixit variable, to compute a suitable default value
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.
2516 There are some auxiliary files for perl5 that need to be put into a
2517 private library directory that is accessible by everyone.
2520 $ IF F$TYPE(privlib) .NES. ""
2521 $ THEN dflt = privlib
2522 $ ELSE dflt = "''vms_prefix':[lib]"
2524 $ rp = "Pathname where the private library files will reside? "
2525 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2529 $ ENDIF !%Config-I-VMS, skip remaining "where install" questions
2531 $ IF F$TYPE(perl_symbol) .EQS. "" THEN perl_symbol := true
2532 $ IF F$TYPE(perl_verb) .EQS. "" THEN perl_verb = ""
2534 $ THEN bool_dflt = "y"
2535 $ ELSE bool_dflt = "n"
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."
2545 $ rp = "Invoke perl as a global symbol foreign command? [''bool_dflt'] "
2547 $ IF (.NOT.ans) THEN perl_symbol = "false"
2549 $ IF (.NOT.perl_symbol)
2551 $ IF perl_verb .EQS. "DCLTABLES"
2552 $ THEN bool_dflt = "n"
2553 $ ELSE bool_dflt = "y"
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)."
2562 $ rp = "Invoke perl as a per process command verb? [ ''bool_dflt' ] "
2565 $ THEN perl_verb = "DCLTABLES"
2566 $ ELSE perl_verb = "PROCESS"
2568 $ ENDIF ! (.NOT.perl_symbol)
2570 $ IF (.NOT.vms_skip_install)
2572 $!: set the prefixup variable, to restore leading tilde escape !sfn
2574 $!: determine where public architecture dependent libraries go
2578 $ echo "''package' contains architecture-dependent library files. If you are"
2584 sharing libraries in a heterogeneous environment, you might store
2585 these files in a separate location. Otherwise, you can just include
2586 them with the rest of the public library files.
2589 $ IF F$TYPE(archlib) .NES. ""
2590 $ THEN dflt = archlib
2591 $ ELSE dflt = privlib - "]" + "." + archname + "." + version + "]"
2593 $ rp = "Where do you want to put the public architecture-dependent libraries? "
2594 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2598 $ ENDIF !%Config-I-VMS, skip "where install" questions
2599 $ IF (.NOT.vms_skip_install)
2601 $!: it so happens the Eunice I know will not run shell scripts in Unix format
2603 $!: see if setuid scripts can be secure !sfn
2604 $!: now see if they want to do setuid emulation !sfn
2606 $!: determine where site specific libraries go.
2612 The installation process will also create a directory for
2613 site-specific extensions and modules. Some users find it convenient
2614 to place all local files in this directory rather than in the main
2615 distribution directory.
2618 $ IF F$TYPE(sitelib) .NES. ""
2619 $ THEN dflt = sitelib
2620 $ ELSE dflt = privlib - "]" + ".SITE_PERL]"
2622 $ rp = "Pathname for the site-specific library files? "
2623 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2627 $!: determine where site specific architecture-dependent libraries go.
2629 $ THEN TYPE SYS$INPUT:
2632 The installation process will also create a directory for
2633 architecture-dependent site-specific extensions and modules.
2636 $ IF F$TYPE(sitearch) .NES. ""
2637 $ THEN dflt = sitearch
2638 $ ELSE dflt = sitelib - "]" + "." + archname + "]"
2640 $ rp = "Pathname for the site-specific architecture-dependent library files? "
2641 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
2645 $!: determine where old public architecture dependent libraries might be
2647 $!: determine where public executables go
2648 $ IF F$TYPE(bin) .NES. ""
2650 $! ELSE dflt = prefix - ".]" + ".BIN]"
2651 $ ELSE dflt = "/''vms_prefix'"
2653 $ rp = "Pathname where the public executables will reside? "
2654 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
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']"
2663 $ rp = "Pathname where the add-on public executables should be installed? "
2664 $ rp = F$FAO("!AS!/!AS",rp,"[ ''dflt' ] ")
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
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
2690 $! These derived locations can be set whether we've opted to
2691 $! skip the where install questions or not.
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]"
2730 $! determine whether to use malloc wrapping
2733 $ IF F$TYPE(usemallocwrap) .nes. ""
2735 $ if .NOT. usemallocwrap .or. usemallocwrap .eqs. "undef" then bool_dflt = "n"
2737 $ rp = "Do you wish to wrap malloc calls to protect against potential overflows? [''bool_dflt'] "
2740 $ THEN usemallocwrap = "define"
2741 $ ELSE usemallocwrap = "undef"
2744 $! Ask if they want to use perl's memory allocator
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."
2751 $ IF F$TYPE(usemymalloc) .nes. ""
2753 $ if usemymalloc .or. usemymalloc .eqs. "define" then bool_dflt = "y"
2755 $ rp = "Do you wish to attempt to use the malloc that comes with ''package'? [''bool_dflt'] "
2760 $ IF use_debugging_perl
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."
2767 $ rp = "Do you want the debugging memory allocator? [''bool_dflt'] "
2769 $ use_debugmalloc = ans
2771 $ ! Check which memory allocator we want
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"
2779 $ echo "PACK_MALLOC."
2781 $ rp = "Memory allocator (DEFAULT, TWO_POT, PACK_MALLOC) [''dflt'] "
2783 $ if ans.eqs."TWO_POT" then use_two_pot_malloc = "Y"
2784 $ if ans.eqs."PACK_MALLOC" then use_pack_malloc = "Y"
2787 $ xs_extensions = ""
2789 $ OPEN/READ CONFIG 'manifestfound'
2791 $ READ/END_OF_FILE=end_ext/ERROR=end_ext CONFIG line
2792 $ IF F$EXTRACT(0,4,line) .NES. "ext/" .AND. -
2793 F$EXTRACT(0,5,line) .NES. "dist/".AND. -
2794 F$EXTRACT(0,5,line) .NES. "cpan/" THEN goto ext_loop
2795 $ line = F$EDIT(line,"COMPRESS")
2796 $ line = F$ELEMENT(0," ",line)
2797 $ IF F$EXTRACT(0,4,line) .EQS. "ext/"
2799 $ xxx = F$ELEMENT(1,"/",line)
2800 $ IF F$SEARCH("[-.ext]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2802 $ IF F$EXTRACT(0,5,line) .EQS. "dist/"
2804 $ xxx = F$ELEMENT(1,"/",line)
2805 $ IF F$SEARCH("[-.dist]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2807 $ IF F$EXTRACT(0,5,line) .EQS. "cpan/"
2809 $ xxx = F$ELEMENT(1,"/",line)
2810 $ IF F$SEARCH("[-.cpan]''xxx'.DIR;1") .EQS. "" THEN GOTO ext_loop
2812 $ IF xxx .EQS. "DynaLoader" THEN goto ext_loop ! omit
2814 $! (extspec = xxx) =~ tr!-!/!
2817 $ extension_dir_name = xxx
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. ""
2823 $ extspec = extspec + "/"
2825 $ extspec = extspec + before
2827 $ goto replace_dash_with_slash
2829 $ end_replace_dash_with_slash:
2831 $ xxx = xs_extensions
2832 $ gosub may_already_have_extension
2836 $ gosub may_already_have_extension
2841 $ gosub may_already_have_extension
2843 $ IF $STATUS .NE. 1 THEN goto ext_loop
2844 $ goto found_new_extension
2846 $ may_already_have_extension:
2847 $ idx = F$LOCATE(extspec, xxx)
2848 $ extlen = F$LENGTH(xxx)
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.
2853 $ IF idx .GT. 0 .AND. F$EXTRACT(idx - 1, 1, xxx) .NES. " "
2855 $ xxx = F$EXTRACT(idx + F$LENGTH(extspec) + 1, extlen, xxx)
2856 $ GOTO may_already_have_extension
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
2864 $ xxx = F$EXTRACT(F$LENGTH(extspec) + 1, extlen, xxx)
2865 GOTO may_already_have_extension
2868 $ found_new_extension:
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"
2874 $! Bit if a hack to get around the 1K buffer on older systems.
2875 $ IF F$LENGTH(nonxs_ext) .GT. 950
2877 $ nonxs_ext2 = nonxs_ext2 + " ''extspec'"
2879 $ nonxs_ext = nonxs_ext + " ''extspec'"
2882 $ xs_extensions = xs_extensions + " ''extspec'"
2889 $ DELETE/SYMBOL extspec
2890 $ DELETE/SYMBOL extlen
2891 $ DELETE/SYMBOL extension_dir_name
2892 $ xs_extensions = F$EDIT(xs_extensions,"TRIM,COMPRESS")
2893 $ dflt = xs_extensions
2894 $ IF ccname .NES. "DEC" .AND. ccname .NES. "CXX"
2896 $ dflt = dflt - "POSIX" ! not with VAX C or GCC
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
2901 $ dflt = dflt - "IPC/SysV" ! needs to be ported
2902 $ dflt = dflt - "NDBM_File" ! needs porting/special library
2903 $ dflt = dflt - "ODBM_File" ! needs porting/special library
2904 $ dflt = dflt - "Sys/Syslog" ! needs porting/special library "GDBM_File macro LOG_DEBUG"
2905 $ IF .NOT. Has_Dec_C_Sockets
2907 $ dflt = dflt - "Socket" ! optional on VMS
2909 $ dflt = dflt - "Win32API/File" - "Win32" ! need Dave Cutler's other project
2910 $ nonxs_ext = nonxs_ext - "Win32CORE"
2911 $ nonxs_ext2 = nonxs_ext2 - "Win32CORE"
2912 $ dflt = F$EDIT(dflt,"TRIM,COMPRESS")
2913 $ nonxs_ext = F$EDIT(nonxs_ext,"TRIM,COMPRESS")
2914 $ nonxs_ext2 = F$EDIT(nonxs_ext2,"TRIM,COMPRESS")
2916 $! Ask for their default list of extensions to build
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."
2923 $ echo "Which modules do you want to build into perl?"
2926 $ dynamic_ext = F$EDIT(ans,"TRIM,COMPRESS")
2928 $! %Config-I-VMS, determine build/make utility here (make gmake mmk mms)
2930 $ echo "Checking your ""make"" utilities..."
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"
2940 $ orig_dflt = f$edit(builder,"UPCASE")
2941 $ if orig_dflt .eqs. "" then orig_dflt = "MMK"
2944 $ OPEN/WRITE/ERROR=Open_error CONFIG Makefile.
2945 $ WRITE CONFIG "dont_make_anything_yet:"
2946 $ WRITE CONFIG F$FAO("!_")
2949 $ messages = F$ENVIRONMENT("MESSAGE")
2951 $ build = F$ELEMENT(n,"/",builders)
2952 $ probe = F$ELEMENT(n,"!",probers)
2953 $ echo "Testing whether you have ''build' on your system..."
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".
2960 $ ON CONTROL_Y THEN GOTO Reenable_messages_build
2961 $ SET MESSAGE/NOFAC/NOSEV/NOIDENT/NOTEXT
2963 $ IF ($SEVERITY .EQ. 1) ! not adequate?
2966 $ IF (build .EQS. orig_dflt)
2968 $ default_set = "TRUE"
2971 $ ok_builders = ok_builders + " " + build
2972 $ IF (.NOT. default_set) THEN dflt = build
2976 $Reenable_messages_build:
2977 $ SET MESSAGE 'messages'
2979 $ on control_y then goto clean_up
2981 $ IF (n .LT. max_build) THEN GOTO Build_probe
2984 $ IF (ok_builders .NES. "")
2986 $ echo "Here is the list of builders you can apparently use:"
2987 $ echo "(",ok_builders," )"
2988 $ rp = "Which """"make"""" utility do you wish to use? [''dflt'] "
2990 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
2991 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
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.
3006 $ READ SYS$COMMAND/PROMPT="Which ""MMS"" do you use? " ans
3007 $ ans = F$EDIT(ans,"TRIM, COMPRESS")
3008 $ ans = F$EXTRACT(0,F$LOCATE(" ",ans),ans) !throw out "-f Makefile." here
3011 $ echo "I do not know where ""make"" is, and my life depends on it."
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
3016 $ EXIT 2 !$STATUS = "%X00000002" (error)
3022 $ DELETE/NOLOG/NOCONFIRM Makefile.;
3028 There seems to be trouble. I just tried to create a file in
3030 $ echo4 'F$ENVIRONMENT("DEFAULT")'
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
3037 $ echo4 "ABORTING..."
3043 $! echo " Very well I will proceed with ""''build'"""
3044 $ make = F$EDIT(build,"UPCASE")
3046 $!: locate the preferred pager for this system
3047 $!pagers = "most|more|less|type/page"
3048 $ IF osvers .GES. "V6.1"
3050 $ dflt = "type/page=save=10"
3052 $ dflt = "type/page"
3054 $! assume that the presence of a most symbol indicates the presence
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'] "
3062 $! update makefile here
3063 $! echo4 "Updating makefile..."
3065 $ IF (make .EQS. "MMS").OR.(make .EQS. "MMK")
3067 $ makefile = "" !wrt MANIFEST dir
3068 $ UUmakefile = "[-]DESCRIP.MMS" !wrt CWD dir
3069 $ DEFmakefile = "DESCRIP.MMS" !wrt DEF dir (?)
3070 $ Makefile_SH = "descrip_mms.template"
3072 $ makefile = " -f Makefile." !wrt MANIFEST dir
3073 $ UUmakefile = "[-]Makefile." !wrt CWD dir
3074 $ DEFmakefile = "Makefile." !wrt DEF dir (?)
3075 $ Makefile_SH = "Makefile.in"
3078 $ IF macros .NES. ""
3080 $ tmp = F$LENGTH(macros)
3081 $ macros = F$EXTRACT(0,(tmp-1),macros) !miss trailing comma
3082 $ macros = "/macro=(" + macros + ")"
3084 $! Build up the extra C flags
3088 $ extra_flags = "''extra_flags'" + "/float=ieee/ieee=denorm"
3090 $ IF (F$ELEMENT(0, "-", archname).EQS."VMS_IA64")
3092 $ extra_flags = "''extra_flags'" + "/float=g_float"
3096 $ IF be_case_sensitive
3098 $ names_flags = "AS_IS"
3100 $ IF shorten_long_symbols
3102 $ IF be_case_sensitive
3104 $ names_flags = "''names_flags',SHORTENED"
3106 $ names_flags = "SHORTENED"
3109 $ IF F$LENGTH(names_flags) .ne. 0
3111 $ extra_flags = "''extra_flags'" + "/NAMES=(''names_flags')"
3113 $ DELETE/SYMBOLS names_flags
3114 $ extra_flags = "''extra_flags'" + "''user_c_flags'"
3116 $ min_pgflquota = "100000"
3117 $ pgflquota = F$STRING(F$GETJPI("","PGFLQUOTA"))
3118 $ IF pgflquota .LES. min_pgflquota
3120 $ echo4 "Your PGFLQUOTA of ''pgflquota' appears too small to build ''package'."
3121 $ READ SYS$COMMAND/PROMPT="Continue? [n] " ans
3124 $ echo4 "Continuing..."
3126 $ echo4 "ABORTING..."
3132 $ echo4 "Checking the C run-time library."
3134 $! Former SUBCONFIGURE.COM
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?)
3142 $! Note for folks from other platforms changing things in here:
3144 $! Fancy changes (based on compiler capabilities or VMS version or
3145 $! whatever) are tricky, so go ahead and punt on those.
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.
3152 $! Add a line in the format:
3154 $! $ WC "foo='undef'"
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:
3166 $! then add a line that looks like this before the
3167 $! '##END WRITE NEW CONSTANTS HERE##' tagged line:
3169 $! $ WC "blank_string='" + "'"
3171 $! (+ is the string concatenator and "''var'" has the effect
3172 $! of "${var}" in perl or sh, but "'const'" is not interpolated).
3174 $! Note that unitialized variables, such as a line like:
3176 $! $ WC "new_var='" + new_var + "'"
3178 $! should be avoided unless new_var has a value assigned prior
3179 $! to that line (think of perl's -w warnings).
3181 $! %DCL-W-UNDSYM, undefined symbol - check validity and spelling
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'"
3189 $ IF ccname .EQS. "DEC"
3191 $ Checkcc := "''Mcc'/prefix=all"
3193 $ IF ccname .EQS. "CXX"
3197 $ Checkcc := "''Mcc'"
3200 $ ccflags = ccflags + extra_flags
3201 $ IF be_case_sensitive
3203 $ d_vms_be_case_sensitive = "define"
3205 $ d_vms_be_case_sensitive = "undef"
3207 $ IF shorten_long_symbols
3209 $ d_vms_shorten_long_symbols = "define"
3211 $ d_vms_shorten_long_symbols = "undef"
3213 $! Some constant defaults.
3214 $ hwname = f$getsyi("HW_NAME")
3215 $ myname = myhostname
3216 $ IF myname .EQS. "" THEN myname = F$TRNLNM("SYS$NODE")
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.
3226 $ usemorebits = "undef"
3227 $ IF use64bitint .OR. use64bitint .EQS. "define"
3229 $ use64bitint = "define"
3230 $ ivdformat="""Ld"""
3231 $ uvuformat="""Lu"""
3232 $ uvoformat="""Lo"""
3233 $ uvxformat="""Lx"""
3234 $ uvXUformat="""LX"""
3236 $ use64bitint = "undef"
3237 $ ivdformat="""ld"""
3238 $ uvuformat="""lu"""
3239 $ uvoformat="""lo"""
3240 $ uvxformat="""lx"""
3241 $ uvXUformat="""lX"""
3243 $ IF uselongdouble .OR. uselongdouble .EQS. "define"
3245 $ uselongdouble = "define"
3247 $ nveformat="""Le"""
3248 $ nvEUformat="""LE"""
3249 $ nvfformat="""Lf"""
3250 $ nvFUformat="""LF"""
3251 $ nvgformat="""Lg"""
3252 $ nvGUformat="""LG"""
3254 $ uselongdouble = "undef"
3256 $ nvEUformat="""E"""
3258 $ nvFUformat="""F"""
3260 $ nvGUformat="""G"""
3262 $ IF use64bitall .OR. use64bitall .EQS. "define"
3264 $ use64bitall = "define"
3266 $ use64bitall = "undef"
3268 $ IF uselargefiles .OR. uselargefiles .EQS. "define"
3270 $ uselargefiles = "define"
3272 $ uselargefiles = "undef"
3275 $ usemymalloc = "undef"
3276 $ if mymalloc then usemymalloc = "define"
3280 $ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_AXP")
3288 $ IF (sharedperl .AND. F$ELEMENT(0, "-", archname) .EQS. "VMS_IA64")
3303 $ dlobj="dl_vms''obj_ext'"
3305 $ cppstdin="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3307 $ cpprun="''perl_cc'/noobj/comments=as_is/preprocess=sys$output sys$input"
3315 $ THEN d_mymalloc="define"
3316 $ ELSE d_mymalloc="undef"
3321 $ startperl="""$ perl 'f$env(\""procedure\"")' \""'"+"'p1'\"" \""'"+"'p2'\"" \""'"+"'p3'\"" \""'"+"'p4'\"" \""'"+"'p5'\"" \""'"+"'p6'\"" \""'"+"'p7'\"" \""'"+"'p8'\""!\n"
3322 $ startperl=startperl + "$ exit++ + ++$status!=0 and $exit=$status=undef; while($#ARGV != -1 and $ARGV[$#ARGV] eq '"+"'){pop @ARGV;}"""
3325 $ IF ccname .EQS. "DEC" .OR. ccname .EQS. "CXX"
3332 $! perllibs should be libs with all non-core libs (such as gdbm) removed.
3337 $ IF F$ELEMENT(0, "-", archname) .NES. "VMS_VAX"
3339 $ d_PRId64 = "define"
3340 $ d_PRIi64 = "define"
3341 $ d_PRIu64 = "define"
3342 $ d_PRIo64 = "define"
3343 $ d_PRIx64 = "define"
3344 $ d_PRIXU64 = "define"
3345 $ sPRId64 = """Ld"""
3346 $ sPRIXU64 = """LX"""
3347 $ sPRIi64 = """Li"""
3348 $ sPRIo64 = """Lo"""
3349 $ sPRIu64 = """Lu"""
3350 $ sPRIx64 = """Lx"""
3352 $ quadtype = "long long"
3353 $ uquadtype = "unsigned long long"
3356 $ d_frexpl = "define"
3357 $ d_modfl = "define"
3358 $ d_modflproto = "define"
3360 $ d_PRId64 = "undef"
3361 $ d_PRIi64 = "undef"
3362 $ d_PRIXU64 = "undef"
3363 $ d_PRIu64 = "undef"
3364 $ d_PRIo64 = "undef"
3365 $ d_PRIx64 = "undef"
3367 $ sPRIXU64 = """lX"""
3373 $ quadtype = "undef"
3374 $ uquadtype = "undef"
3375 $ quadkind = "undef"
3377 $ d_frexpl = "undef"
3379 $ d_modflproto = "undef"
3382 $ IF useieee .OR. useieee .EQS. "define"
3384 $ d_isnan = "define"
3385 $ d_isnanl = "define"
3388 $ d_isnanl = "undef"
3391 $! Now some that we build up
3393 $ use5005threads = "undef"
3394 $ d_old_pthread_create_joinable = "undef"
3395 $ old_pthread_create_joinable = " "
3398 $ useithreads = "define"
3400 $ useithreads = "undef"
3403 $! Some that we need to invoke the compiler for
3406 $! handy construction aliases/symbols
3408 $ OS := "open/write CONFIG []try.c"
3409 $ WS := "write CONFIG"
3410 $ CS := "close CONFIG"
3411 $ DS := "delete/nolog/noconfirm []try.*;*"
3413 $ good_compile = %X10B90001
3414 $ IF ccname .EQS. "GCC"
3416 $ open/write OPTCHAN []try.opt
3417 $ write OPTCHAN "Gnu_CC:[000000]gcclib.olb/library"
3418 $ write OPTCHAN "Sys$Share:VAXCRTL/Share"
3421 $ good_compile = %X10000001
3423 $ IF ccname .EQS. "CXX"
3425 $ good_compile = %X15F60001
3427 $ good_link = %X10000001
3428 $ tmp = "" ! null string default
3430 $ GOTO beyond_compile_ok
3432 $! Check for type sizes
3437 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3438 $ WS "#include <stdlib.h>"
3440 $ WS "#include <stdio.h>"
3443 $ WS "printf(""%d\n"", sizeof(''tmp'));"
3450 $!: locate header file
3454 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3455 $ WS "#include <stdlib.h>"
3457 $ WS "#include <stdio.h>"
3458 $ WS "#include <''tmp'>"
3461 $ WS "printf(""define\n"");"
3468 $!: define an alternate in-header-list? function
3472 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3474 $ echo4 "<''tmp'> found."
3477 $ echo4 "<''tmp'> NOT found."
3482 $!: define an is-in-libc? function
3485 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3487 $ echo4 "''tmp'() found."
3490 $ echo4 "''tmp'() NOT found."
3495 $!: define a shorthand compile call
3499 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3501 $ OPEN/WRITE CONFIG []try.out
3502 $ DEFINE/USER_MODE SYS$ERROR CONFIG
3503 $ DEFINE/USER_MODE SYS$OUTPUT CONFIG
3506 $ OPEN/READ CONFIG []try.out
3509 $ DELETE/NOLOG/NOCONFIRM []try.out;
3510 $ DELETE/NOLOG/NOCONFIRM []try.exe;
3512 $ tmp = "" ! null string default
3518 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3519 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3523 $ 'ld' try.obj,try.opt/opt
3524 $ link_status = $status
3527 $ link_status = $status
3530 $ IF F$SEARCH("try.obj") .NES. "" THEN DELETE/NOLOG/NOCONFIRM try.obj;
3533 $!: define a shorthand compile call for compilations that should be ok.
3535 $ DEFINE/USER_MODE SYS$ERROR _NLA0:
3536 $ DEFINE/USER_MODE SYS$OUTPUT _NLA0:
3539 $ compile_status = $status
3541 $ DELETE/NOLOG/NOCONFIRM try.c;
3546 $! Check for __STDC__
3549 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3550 $ WS "#include <stdlib.h>"
3552 $ WS "#include <stdio.h>"
3555 $ WS "#ifdef __STDC__"
3556 $ WS "printf(""42\n"");"
3557 $ WS "#elif defined (__STD_ANSI)" ! for CXX
3558 $ WS "printf(""42\n"");"
3560 $ WS "printf(""1\n"");"
3567 $ IF F$INTEGER(tmp) .eq. 42
3569 $ echo4 "Oh! Smells like ANSI's been here."
3570 $ echo "We can catify or stringify, separately or together!"
3573 $! Check for double size
3575 $ echo4 "Checking to see how big your double precision numbers are..."
3577 $ GOSUB type_size_check
3579 $ echo "Your double is ''doublesize' bytes long."
3581 $! Check for long double size
3584 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3585 $ WS "#pragma message disable ALL" ! VAX compilers may have distracting informationals
3586 $ WS "#include <stdlib.h>"
3588 $ WS "#include <stdio.h>"
3591 $ WS "printf(""%d\n"", sizeof(long double));"
3595 $ echo4 "Checking to see if you have long double..."
3597 $ IF link_status .NE. good_link
3601 $ echo "You do not have long double."
3603 $ echo "You have long double."
3604 $ echo4 "Checking to see how big your long doubles are..."
3607 $ d_longdbl = "define"
3608 $ echo "Your long doubles are ''longdblsize' bytes long."
3611 $ IF d_longdbl .OR. d_longdbl .EQS. "define"
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"""
3626 $ d_PRIEUldbl = "undef"
3627 $ d_PRIFUldbl = "undef"
3628 $ d_PRIGUldbl = "undef"
3629 $ d_PRIeldbl = "undef"
3630 $ d_PRIfldbl = "undef"
3631 $ d_PRIgldbl = "undef"
3639 $ d_SCNfldbl = d_PRIfldbl
3640 $ sSCNfldbl = sPRIfldbl ! expect consistency
3642 $!: check for long long
3644 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3645 $ WS "#include <stdlib.h>"
3647 $ WS "#include <stdio.h>"
3650 $ WS "printf(""%d\n"", sizeof(long long));"
3654 $ echo4 "Checking to see if you have long long..."
3656 $ IF link_status .NE. good_link
3659 $ d_longlong="undef"
3660 $ echo "You do not have long long."
3662 $ echo "You have long long."
3663 $ echo4 "Checking to see how big your long longs are..."
3665 $ longlongsize = tmp
3666 $ d_longlong = "define"
3667 $ echo "Your long longs are ''longlongsize' bytes long."
3670 $! Check the prototype for getgid
3672 $ echo "Looking for the type for group ids returned by getgid()."
3674 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3675 $ WS "#include <stdlib.h>"
3677 $ WS "#include <stdio.h>"
3678 $ WS "#include <types.h>"
3686 $ IF compile_status .NE. good_compile
3688 $! Okay, gid_t failed. Must be unsigned int
3689 $ gidtype = "unsigned int"
3690 $ echo4 "assuming ""''gidtype'""."
3693 $ echo4 "gid_t found."
3696 $! Check to see if we've got dev_t
3698 $ echo "Looking for the type for dev."
3700 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3701 $ WS "#include <stdlib.h>"
3703 $ WS "#include <stdio.h>"
3704 $ WS "#include <types.h>"
3712 $ IF compile_status .NE. good_compile
3714 $! Okay, dev_t failed. Must be unsigned int
3715 $ devtype = "unsigned int"
3716 $ echo4 "assuming ""''devtype'""."
3719 $ echo4 "dev_t found."
3722 $! Check to see if we've got unistd.h (which we ought to, but you never know)
3729 $! Check to see if we've got utime.h (which we should use if we have)
3736 $! do we have getppid()?
3738 $ IF i_unistd .EQS. "define"
3741 $ WS "#include <stdio.h>"
3742 $ WS "#include <unistd.h>"
3744 $ WS "printf(""%d\n"",getppid());"
3752 $ d_getppid = "undef"
3755 $!: see if this is a libutil.h system
3761 $! Check to see if we've got shadow.h (probably not, but...)
3767 $! Check to see if we've got socks.h (probably not, but...)
3773 $! Check the prototype for select
3775 $ IF Has_Dec_C_Sockets
3778 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3779 $ WS "#include <stdlib.h>"
3781 $ WS "#include <stdio.h>"
3782 $ WS "#include <types.h>"
3783 $ IF i_unistd .EQS. "define" THEN WS "#include <unistd.h>"
3784 $ WS "#include <time.h>"
3785 $ WS "#include <socket.h>"
3791 $ WS "bar = select(2, foo, foo, foo, NULL);"
3796 $ IF compile_status .NE. good_compile
3798 $! Okay, select failed. Must be an int *
3799 $ selecttype = "int *"
3800 $ echo4 "select() NOT found."
3802 $ selecttype="fd_set *"
3803 $ echo4 "select() found."
3806 $ ! No sockets, so stick in an int * : no select, so pick a harmless default
3807 $ selecttype = "int *"
3810 $! Check to see if fd_set exists
3812 $ echo "Checking to see how well your C compiler handles fd_set and friends ..."
3814 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3815 $ WS "#include <stdlib.h>"
3817 $ WS "#include <stdio.h>"
3818 $ WS "#include <types.h>"
3819 $ IF Has_Dec_C_Sockets
3821 $ WS "#include <time.h>"
3822 $ WS "#include <socket.h>"
3832 $ IF compile_status .ne. good_compile
3834 $! Okay, fd_set failed. Must not exist
3835 $ d_fd_set = "undef"
3836 $ echo4 "Hmm, your compiler has some difficulty with fd_set."
3839 $ echo4 "Well, your system knows about the normal fd_set typedef..."
3842 $! Check for inttypes.h
3844 $ tmp = "inttypes.h"
3848 $! Check to see if off64_t exists
3850 $ echo4 "Checking to see if you have off64_t..."
3852 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3853 $ WS "#include <stdlib.h>"
3855 $ WS "#include <stdio.h>"
3856 $ WS "#include <types.h>"
3857 $ WS "#''i_inttypes' IIH"
3859 $ WS "#include <inttypes.h>"
3868 $ IF compile_status .EQ. good_compile
3870 $ d_off64_t="define"
3871 $ echo "You have off64_t."
3873 $ d_off64_t = "undef"
3874 $ echo "You do not have off64_t."
3877 $! Check to see if fpos64_t exists
3879 $ echo4 "Checking to see if you have fpos64_t..."
3881 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3882 $ WS "#include <stdlib.h>"
3884 $ WS "#include <stdio.h>"
3885 $ WS "#include <types.h>"
3886 $ WS "#''i_inttypes' IIH"
3888 $ WS "#include <inttypes.h>"
3892 $ WS "fpos64_t bar;"
3897 $ IF compile_status .EQ. good_compile
3899 $ d_fpos64_t="define"
3900 $ echo "You have fpos64_t."
3902 $ d_fpos64_t = "undef"
3903 $ echo "You do not have fpos64_t."
3906 $! Check to see if int64_t exists
3908 $ echo4 "Checking to see if you have int64_t..."
3910 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3911 $ WS "#include <stdlib.h>"
3913 $ WS "#include <stdio.h>"
3914 $ WS "#include <types.h>"
3915 $ WS "#''i_inttypes' IIH"
3917 $ WS "#include <inttypes.h>"
3926 $ IF compile_status .EQ. good_compile
3928 $ d_int64_t="define"
3929 $ echo "You have int64_t."
3931 $ d_int64_t = "undef"
3932 $ echo "You do not have int64_t."
3935 $! Check to see if fseeko exists
3938 $ WS "#include <stdio.h>"
3941 $ WS "FILE *f=NULL;"
3942 $ WS "fseeko(f,(off_t)0,SEEK_SET);"
3950 $! Check to see if ftello exists
3953 $ WS "#include <stdio.h>"
3956 $ WS "FILE *f=NULL; off_t o=0;"
3965 $!: see if this is a netdb.h system
3966 $ IF Has_Dec_C_Sockets
3973 $! Check for h_errno
3975 $ echo4 "Checking to see if you have h_errno..."
3977 $ WS "#if defined(__DECC) || defined(__DECCXX)"
3978 $ WS "#include <stdlib.h>"
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>"
3990 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
3993 $ echo "You have h_errno."
3996 $ echo "You do not have h_errno."
3999 $! Check to see if gethostname exists
4001 $ IF Has_Dec_C_Sockets
4004 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4005 $ WS "#include <stdlib.h>"
4007 $ WS "#include <stdio.h>"
4008 $ WS "#include <types.h>"
4009 $ WS "#include <time.h>"
4010 $ WS "#include <socket.h>"
4013 $ WS "char name[100];"
4014 $ WS "int bar, baz;"
4016 $ WS "baz = gethostname(name, bar);"
4021 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4023 $ d_gethname="define"
4024 $ echo4 "gethostname() found."
4026 $ d_gethname="undef"
4029 $ ! No sockets, so no gethname
4030 $ d_gethname = "undef"
4033 $! Check for sys/file.h
4035 $ tmp = "sys/file.h"
4040 $! Check for sys/ioctl.h
4042 $ tmp = "sys/ioctl.h"
4046 $! Check for sys/utsname.h
4048 $ tmp = "sys/utsname.h"
4050 $ i_sysutsname = tmp
4052 $! Check for syslog.h
4064 $! Check for sys/uio.h
4070 $! Check for sys/mode.h
4072 $ tmp = "sys/mode.h"
4078 $ tmp = "sys/poll.h"
4082 $! Check for sys/access.h
4084 $ tmp = "sys/access.h"
4088 $! Check for sys/security.h
4090 $ tmp = "sys/security.h"
4094 $! Check for fcntl.h
4103 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4104 $ WS "#include <stdlib.h>"
4106 $ WS "#include <stdio.h>"
4107 $ WS "#include <fcntl.h>"
4110 $ WS "fcntl(1,2,3);"
4118 $! Check for fcntl locking capability
4120 $ echo4 "Checking if fcntl-based file locking works... "
4122 $ IF d_fcntl .EQS. "define"
4125 $ WS "#include <stdio.h>"
4126 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4127 $ WS "#include <stdlib.h>"
4129 $ WS "#include <fcntl.h>"
4130 $ WS "#include <unistd.h>"
4132 $ WS "#if defined(F_SETLK) && defined(F_SETLKW)"
4133 $ WS " struct flock flock;"
4134 $ WS " int retval, fd;"
4135 $ WS " fd = open(""[-]perl.c"", O_RDONLY);"
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);"
4141 $ WS " (retval < 0 ? printf(""undef\n"") : printf(""define\n""));"
4143 $ WS " printf(""undef\n"");"
4148 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4151 $ IF tmp .EQS. "define"
4153 $ echo4 "Yes, it seems to work."
4155 $ echo4 "Nope, it didn't work."
4158 $ echo4 "I'm unable to compile the test program, so I'll assume not."
4162 $ echo4 "Nope, since you don't even have fcntl()."
4164 $ d_fcntl_can_lock = tmp
4169 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4170 $ WS "#include <stdlib.h>"
4172 $ WS "#include <string.h>"
4175 $ WS "char * place;"
4176 $ WS "place = (char *)memchr(""foo"", 47, 3);"
4184 $! Check for strtoull
4187 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4188 $ WS "#include <stdlib.h>"
4190 $ WS "#include <string.h>"
4193 $ WS "unsigned __int64 result;"
4194 $ WS "result = strtoull(""123123"", NULL, 10);"
4202 $! Check for strtouq
4205 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4206 $ WS "#include <stdlib.h>"
4208 $ WS "#include <string.h>"
4211 $ WS "unsigned __int64 result;"
4212 $ WS "result = strtouq(""123123"", NULL, 10);"
4220 $! Check for strtoll
4223 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4224 $ WS "#include <stdlib.h>"
4226 $ WS "#include <string.h>"
4229 $ WS "__int64 result;"
4230 $ WS "result = strtoll(""123123"", NULL, 10);"
4241 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4242 $ WS "#include <stdlib.h>"
4244 $ WS "#include <string.h>"
4247 $ WS "__int64 result;"
4248 $ WS "result = strtoq(""123123"", NULL, 10);"
4256 $! Check for strtold
4259 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4260 $ WS "#include <stdlib.h>"
4262 $ WS "#include <string.h>"
4265 $ WS "long double result;"
4266 $ WS "result = strtold(""123123"", NULL, 10);"
4277 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4278 $ WS "#include <stdlib.h>"
4280 $ WS "#include <string.h>"
4283 $ WS " __int64 result;"
4284 $ WS "result = atoll(""123123"");"
4295 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4296 $ WS "#include <stdlib.h>"
4298 $ WS "#include <string.h>"
4302 $ WS "result = atolf(""123123"");"
4313 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4314 $ WS "#include <stdlib.h>"
4316 $ WS "#include <stdio.h>"
4319 $ WS "access(""foo"", F_OK);"
4330 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4331 $ WS "#include <stdlib.h>"
4333 $ WS "#include <stdio.h>"
4334 $ WS "#include <strings.h>"
4337 $ WS "char foo[10];"
4338 $ WS "bzero(foo, 10);"
4349 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4350 $ WS "#include <stdlib.h>"
4352 $ WS "#include <stdio.h>"
4353 $ WS "#include <strings.h>"
4356 $ WS "char foo[10], bar[10];"
4357 $ WS "bcopy(""foo"", bar, 3);"
4365 $! Check for mkstemp
4368 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4369 $ WS "#include <stdlib.h>"
4371 $ WS "#include <stdio.h>"
4374 $ WS "mkstemp(""foo"");"
4382 $! Check for mkstemps
4385 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4386 $ WS "#include <stdlib.h>"
4388 $ WS "#include <stdio.h>"
4391 $ WS "mkstemps(""foo"", 1);"
4399 $! Check for mkdtemp
4402 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4403 $ WS "#include <stdlib.h>"
4405 $ WS "#include <stdio.h>"
4408 $ WS "mkdtemp(""foo"");"
4418 $ if i_poll .eqs. "define"
4421 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4422 $ WS "#include <stdlib.h>"
4424 $ WS "#include <poll.h>"
4427 $ WS "struct pollfd pfd;"
4428 $ WS "int count=poll(&pfd,1,0);"
4439 $! Check for setvbuf
4442 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4443 $ WS "#include <stdlib.h>"
4445 $ WS "#include <stdio.h>"
4449 $ WS "char Buffer[99];"
4450 $ WS "foo = fopen(""foo"", ""r"");"
4451 $ WS "setvbuf(foo, Buffer, 0, 0);"
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"
4465 $! IF usesfio .EQS. "define"
4469 $! echo "''package' can use the sfio library, but it is experimental."
4470 $! rp="You seem to have sfio available, do you want to try using it? [''dflt'] "
4472 $! IF ans .EQS. "" THEN ans = dflt
4475 $! echo "Ok, turning on sfio then."
4478 $! echo "Ok, avoiding sfio this time. I'll use stdio instead."
4482 $! IF usesfio .EQS. "define"
4484 $! echo4 "Sorry, cannot find sfio on this machine."
4485 $! echo4 "Ignoring your setting of usesfio=''usesfio'."
4493 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4494 $ WS "#include <stdlib.h>"
4496 $ WS "#include <stdio.h>"
4499 $ WS "setenv(""FOO"", ""BAR"", 0);"
4507 $! Check for setproctitle
4510 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4511 $ WS "#include <stdlib.h>"
4513 $ WS "#include <stdio.h>"
4516 $ WS "setproctitle(""%s"", ""FOO"");"
4520 $ tmp = "setproctitle"
4522 $ d_setproctitle = tmp
4524 $! Check for <netinet/in.h>
4526 $ IF Has_Dec_C_Sockets
4528 $ tmp = "netinet/in.h"
4535 $! Check for <netinet/tcp.h>
4537 $ IF Has_Dec_C_Sockets
4539 $ tmp = "netinet/tcp.h"
4541 $ i_netinettcp = tmp
4543 $ i_netinettcp="undef"
4546 $! Check for endhostent
4548 $ IF Has_Dec_C_Sockets
4551 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4552 $ WS "#include <stdlib.h>"
4554 $ WS "#include <stdio.h>"
4555 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4558 $ WS "endhostent();"
4562 $ tmp = "endhostent"
4569 $! Check for endnetent
4571 $ IF Has_Dec_C_Sockets
4574 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4575 $ WS "#include <stdlib.h>"
4577 $ WS "#include <stdio.h>"
4578 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4592 $! Check for endprotoent
4594 $ IF Has_Dec_C_Sockets
4597 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4598 $ WS "#include <stdlib.h>"
4600 $ WS "#include <stdio.h>"
4601 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4604 $ WS "endprotoent();"
4608 $ tmp = "endprotoent"
4615 $! Check for endservent
4617 $ IF Has_Dec_C_Sockets
4620 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4621 $ WS "#include <stdlib.h>"
4623 $ WS "#include <stdio.h>"
4624 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4627 $ WS "endservent();"
4631 $ tmp = "endservent"
4638 $! Check for sethostent
4640 $ IF Has_Dec_C_Sockets
4643 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4644 $ WS "#include <stdlib.h>"
4646 $ WS "#include <stdio.h>"
4647 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4650 $ WS "sethostent(1);"
4654 $ tmp = "sethostent"
4661 $! Check for setnetent
4663 $ IF Has_Dec_C_Sockets
4666 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4667 $ WS "#include <stdlib.h>"
4669 $ WS "#include <stdio.h>"
4670 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4673 $ WS "setnetent(1);"
4684 $! Check for setprotoent
4686 $ IF Has_Dec_C_Sockets
4689 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4690 $ WS "#include <stdlib.h>"
4692 $ WS "#include <stdio.h>"
4693 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4696 $ WS "setprotoent(1);"
4700 $ tmp = "setprotoent"
4707 $! Check for setservent
4709 $ IF Has_Dec_C_Sockets
4712 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4713 $ WS "#include <stdlib.h>"
4715 $ WS "#include <stdio.h>"
4716 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4719 $ WS "setservent(1);"
4723 $ tmp = "setservent"
4730 $! Check for gethostent
4732 $ IF Has_Dec_C_Sockets
4735 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4736 $ WS "#include <stdlib.h>"
4738 $ WS "#include <stdio.h>"
4739 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4742 $ WS "gethostent();"
4746 $ tmp = "gethostent"
4753 $! Check for getnetent
4755 $ IF Has_Dec_C_Sockets
4758 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4759 $ WS "#include <stdlib.h>"
4761 $ WS "#include <stdio.h>"
4762 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4776 $! Check for getprotoent
4778 $ IF Has_Dec_C_Sockets
4781 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4782 $ WS "#include <stdlib.h>"
4784 $ WS "#include <stdio.h>"
4785 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4788 $ WS "getprotoent();"
4792 $ tmp = "getprotoent"
4799 $! Check for getservent
4801 $ IF Has_Dec_C_Sockets
4804 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4805 $ WS "#include <stdlib.h>"
4807 $ WS "#include <stdio.h>"
4808 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4811 $ WS "getservent();"
4815 $ tmp = "getservent"
4825 $ echo4 "Checking the availability of sa_len in the sockaddr struct ..."
4826 $ IF Has_Dec_C_Sockets
4829 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4830 $ WS "#include <stdlib.h>"
4832 $ WS "#define _SOCKADDR_LEN"
4833 $ WS "#include <types.h>"
4834 $ WS "#include <socket.h>"
4835 $ WS "#include <string.h>"
4837 $ WS "struct sockaddr sa;"
4838 $ WS "memset((char *)&sa, 0, sizeof(sa));"
4839 $ WS "return (sa.sa_len);"
4843 $ IF compile_status .EQ. good_compile
4845 $ d_sockaddr_sa_len="define"
4846 $ echo "You have sa_len in the sockaddr struct."
4848 $ d_sockaddr_sa_len="undef"
4849 $ echo "You do not have sa_len in the sockaddr struct."
4852 $ d_sockaddr_sa_len="undef"
4853 $ echo "You do not have sa_len in the sockaddr struct."
4856 $! Check for sin6_scope_id
4858 $ echo4 "Checking the availability of sin6_scope_id in the struct sockaddr_in6 ..."
4859 $ IF Has_Dec_C_Sockets
4862 $ WS "#include <types.h>"
4863 $ WS "#include <socket.h>"
4864 $ WS "#include <in.h>"
4865 $ WS "#include <string.h>"
4867 $ WS "struct sockaddr_in6 sin6;"
4868 $ WS "memset((char *)&sin6, 0, sizeof(sin6));"
4869 $ WS "return (sin6.sin6_scope_id);"
4873 $ IF compile_status .EQ. good_compile
4875 $ d_sin6_scope_id="define"
4876 $ echo "You have sin6_scope_id in the sockaddr_in6 struct."
4878 $ d_sin6_scope_id="undef"
4879 $ echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
4882 $ d_sin6_scope_id="undef"
4883 $ echo "You do not have sin6_scope_id in the sockaddr_in6 struct."
4886 $! Check for nanosleep
4889 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4890 $ WS "#include <stdlib.h>"
4892 $ WS "#include <time.h>"
4895 $ WS "int asleep = nanosleep(NULL,NULL);"
4903 $! Check for socklen_t
4905 $ IF Has_Dec_C_Sockets
4907 $ echo4 "Checking to see if you have socklen_t..."
4909 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4910 $ WS "#include <stdlib.h>"
4912 $ WS "#include <stdio.h>"
4913 $ IF i_netdb .EQS. "define" THEN WS "#include <netdb.h>"
4916 $ WS "socklen_t x = 16;"
4921 $ IF compile_status .EQ. good_compile .AND. link_status .EQ. good_link
4923 $ d_socklen_t="define"
4924 $ echo "You have socklen_t."
4926 $ d_socklen_t="undef"
4927 $ echo "You do not have socklen_t."
4930 $ d_socklen_t="undef"
4933 $! Check for pthread_yield
4938 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4939 $ WS "#include <stdlib.h>"
4941 $ WS "#include <pthread.h>"
4942 $ WS "#include <stdio.h>"
4945 $ WS "pthread_yield();"
4949 $ tmp = "pthread_yield"
4951 $ d_pthread_yield = tmp
4953 $ d_pthread_yield="undef"
4956 $! Check for sched_yield
4961 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4962 $ WS "#include <stdlib.h>"
4964 $ WS "#include <pthread.h>"
4965 $ WS "#include <stdio.h>"
4968 $ WS "sched_yield();"
4972 $ tmp = "sched_yield"
4974 $ d_sched_yield = tmp
4975 $ IF d_sched_yield .EQS. "define"
4976 $ THEN sched_yield = "sched_yield"
4977 $ ELSE sched_yield = " "
4980 $ d_sched_yield="undef"
4984 $! Check for pthread_attr_setscope and PTHREAD_SCOPE_SYSTEM.
4985 $! (The actual test is to be written.)
4987 $ d_pthread_attr_setscope="undef"
4989 $! Check for generic pointer size
4991 $ echo4 "Checking to see how big your pointers are..."
4993 $ WS "#if defined(__DECC) || defined(__DECCXX)"
4994 $ WS "#include <stdlib.h>"
4996 $ WS "#include <stdio.h>"
5000 $ WS "foo = sizeof(char *);"
5001 $ WS "printf(""%d\n"", foo);"
5006 $ GOSUB type_size_check
5008 $ echo "Your pointers are ''ptrsize' bytes long."
5010 $! Check for size_t size
5014 $ echo4 "Checking the size of ''zzz'..."
5015 $ GOSUB type_size_check
5017 $ echo "Your ''zzz' size is ''sizesize' bytes."
5019 $! Check for _LARGEFILE capability.
5023 $ WS "#define _LARGEFILE"
5024 $ WS "#include <stdio.h>"
5027 $ WS "printf(""%d\n"", sizeof(off_t));"
5032 $ IF link_status .EQ. good_link
5037 $ echo "Your off_t size is ''off_t_size' bytes when _LARGEFILE is defined."
5038 $ IF off_t_size .ne. 8 .AND. (uselargefiles .OR. uselargefiles .eqs. "define")
5040 $ echo4 "You configured with -Duselargefiles but your CRTL does not support _LARGEFILE."
5041 $ echo4 "I'm disabling large file support."
5042 $ uselargefiles = "undef"
5045 $! Check for st_ino size.
5049 $ WS "#include <sys/stat.h>"
5050 $ WS "#include <stdio.h>"
5051 $ WS "#if defined(__DECC) || defined(__DECCXX)"
5052 $ WS "#include <stdlib.h>
5055 $ WS "#''uselargefiles' _LARGEFILE"
5056 $ WS "#ifdef _LARGEFILE"
5057 $ WS " printf(""%d\n"", sizeof(__ino64_t));"
5059 $ WS " printf(""%d\n"", sizeof(unsigned short)*3);"
<