1 $! #!/bin/sh ---> MYCONFIG.COM
3 $! # This script is designed to provide a handy summary of the configuration
4 $! # information being used to build perl. This is especially useful if you
5 $! # are requesting help from comp.lang.perl.misc on usenet or via mail.
7 $! DCL-ified by Peter Prymmer <pvhp@lns62.lns.cornell.edu> 22-DEC-1995
8 $! DCL usage (choose one):
10 $! @MYCONFIG/OUTPUT=MYCONFIG.OUT !or
11 $! @MYCONFIG [node::][which$disk:][[dir.subdir]]CONFIG.SH !or
12 $! @MYCONFIG/OUTPUT=MYCONFIG.OUT [node::][w$disk:][[dir]]CONFIG.SH
14 $! Incorporates Charles Bailey's ideas about bootstrapping system info -
15 $! myconfig.com is now callable as a "myconfig" target in your maker and
16 $! may even work if miniperl.exe and config.sh files fail to be made.
18 $! MMK/DESCRIP=[.VMS] !(or MMS or MAKE)
19 $! does not work then try:
20 $! MMK/DESCRIP=[.VMS]/OUTPUT=MYPERLBUILD.PROBLEM !(or MMS or MAKE)
21 $! Then discuss the MYPERLBUILD.PROBLEM file with a local expert.
22 $! If that still does not work then try:
23 $! MMK/DESCRIP=[.VMS]/OUT=MYNONFIG.OUT MYCONFIG !(or MMS or MAKE)
24 $! send output (MYNONFIG.OUT) to an outside expert and ask politely for help.
26 $ ECHO = "WRITE SYS$OUTPUT "
27 $ RATHER_LONG_DEFAULT_DIRECTORY_NAME = F$ENVIRONMENT("DEFAULT")
29 $ if (p1.nes."").and.(p2.eqs."")
30 $ then RATHER_LONG_FILENAME_TO_FIND = p1 !no typo-checking (experts only)
31 $ else RATHER_LONG_FILENAME_TO_FIND = "CONFIG.SH"
34 $ RATHER_LONG_FILENAME_SEARCH = F$Search(RATHER_LONG_FILENAME_TO_FIND)
35 $ if RATHER_LONG_FILENAME_SEARCH.EQS.""
37 $ if f$parse(f$environment("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
42 $ ECHO "Can't find the perl config.sh file produced by Configure"
43 $ set default 'RATHER_LONG_DEFAULT_DIRECTORY_NAME'
45 $ goto cannot_find_config_sh
49 $ open/read RATHER_LONG_CONFIG_FILE_HANDLE 'RATHER_LONG_FILENAME_SEARCH'
51 $ read/end_of_file = Done RATHER_LONG_CONFIG_FILE_HANDLE line
52 $ name = f$extract(0,f$locate("=",line),line)
53 $ start = f$locate("'",line)+1
54 $ stop = f$locate("'",line)
55 $ value = f$extract(start,stop-start,line)
56 $ if (f$locate("#",name).eqs.f$length(name)).and. -
58 (name.nes."'") - !bug in configure.com for osvers='' ?
59 then $$'name' = "'" + value !$ not necessary but looks more sh-ish
63 $ close RATHER_LONG_CONFIG_FILE_HANDLE
66 $cannot_find_config_sh:
67 $! these parameters are assumed to be passed from make/mm[s|k]:
68 $! p1=$(CC), p2=$(CFLAGS), p3=$(LINKFLAGS),
69 $! p4=$(LIBS1), p5=$(LIBS2), p6=$(SOCKLIB),
70 $! p7=$(EXT), p8=$(DBG)
71 $! so assign to appropriate $var:
72 $ $cc = "'"+p1+"'" ! p1=$(CC) from make
73 $ $ccflags = "'"+p2+"'" ! p2=$(CFLAGS) from make
74 $ $ldflags = "'"+p3+"'" ! p3=$(LINKFLAGS) from make
75 $ $libs = "'"+p4+" "+p5+" "+p6+"'" ! p4$(LIBS1),p5$(LIBS2),p6$(SOCKLIB)frm make
76 $ $staticexts = "'"+p7+"'" ! p7=$(EXT) from make
78 $! hard-coded stuff (for now):
79 $ $cppflags = "'"+"'" !(vestigal)
80 $ $optimize = "'"+"'" !descrip.mms has /Optimize=2 in $(XTRACCFLAGS)
82 $ $osname = "'"+f$edit(f$getsyi("NODE_SWTYPE"),"COLLAPSE")
83 $ $osvers = f$edit(f$getsyi("VERSION")-"V","COLLAPSE")
84 $ if f$getsyi("HW_MODEL").GT.1024
85 $ then $$archname = "'VMS_AXP'" !string from descrip.mms vmsperl 12-21-95
86 $ else $$archname = "'VMS_VAX'" !string from descrip.mms vmsperl 12-21-95
89 $ if $myname.eqs."" then $$myname = f$trnlnm("ARPANET_HOST_NAME")
90 $ if $myname.eqs."" then $$myname = f$trnlnm("INTERNET_HOST_NAME")
91 $ if $myname.eqs."" then $$myname = f$trnlnm("MULTINET_HOST_NAME")
92 $ if $myname.eqs."" then $$myname = f$trnlnm("UCX$INET_HOST_NAME")
93 $ if $myname.eqs."" then $$myname = f$trnlnm("TCPWARE_DOMAINNAME")
94 $ if $myname.eqs."" then $$myname = f$trnlnm("NEWS_ADDRESS")
95 $ if $myname.eqs."" then $$myname = f$trnlnm("SYS$NODE")
96 $! Is this same as configure.com ? (spacing/order unknown):
97 $ $myuname=$osname+" "+$myname+" "+$osvers+" "+F$GetSyi("HW_NAME")+"'"
98 $ $osname = $osname+"'"
99 $ $osvers = "'"+$osvers+"'"
101 $look_for_patchlevel_h:
103 $ RATHER_LONG_FILENAME_TO_FIND = "PATCHLEVEL.H"
104 $Research_patchlevel_h:
105 $ RATHER_LONG_FILENAME_SEARCH = F$Search(RATHER_LONG_FILENAME_TO_FIND)
106 $ if RATHER_LONG_FILENAME_SEARCH.EQS.""
108 $ if f$parse(f$environment("DEFAULT"),,,"DIRECTORY",).NES."[000000]"
111 $ goto Research_patchlevel_h
113 $ ECHO "Can't find the header file patchlevel.h used to make config.sh"
114 $ set default 'RATHER_LONG_DEFAULT_DIRECTORY_NAME'
119 $ open/read RATHER_LONG_CONFIG_FILE_HANDLE 'RATHER_LONG_FILENAME_SEARCH'
121 $ read/end_of_file = patchlevel_h_Done RATHER_LONG_CONFIG_FILE_HANDLE line
122 $ if f$locate("PERL_VERSION",line).ne.f$length(line)
124 $ line = f$edit(line,"TRIM,COMPRESS")
125 $ $PATCHLEVEL = f$element(2," ",line)
126 $ if f$type($SUBVERSION).nes."" then goto patchlevel_h_Done
128 $ if f$locate("PERL_SUBVERSION",line).ne.f$length(line)
130 $ line = f$edit(line,"TRIM,COMPRESS")
131 $ $SUBVERSION = f$element(2," ",line)
132 $ if f$type($PATCHLEVEL).nes."" then goto patchlevel_h_Done
134 $ goto read_patchlevel_h
137 $ close RATHER_LONG_CONFIG_FILE_HANDLE
138 $ if $PATCHLEVEL.eqs.""
140 $ echo "warning: PERL_VERSION was not found in ''RATHER_LONG_FILENAME_TO_FIND':"
144 $ if (p8.nes."").and.($ld.nes."") then $ld = $ld + " DBG='"+p8+"'"
145 $! $spitshell = ECHO !<<!GROK!THIS!
147 $ ECHO "Summary of my ''$package' (version ''$PATCHLEVEL' subversion ''$SUBVERSION') configuration:"
149 $ ECHO " osname=''$osname', osvers=''$osvers', archname=''$archname'"
150 $ ECHO " uname=''$myuname'" !->d_has_uname?
151 $ ECHO " hint=''$hint' d_sigaction='undef'" !->hintfile?
152 $ ECHO " static exts=''$staticexts'" ! added for VMS
154 $ ECHO " cc=''$cc', optimize=''$optimize', ld=''$ld'"
155 $ ECHO " cppflags=''$cppflags'"
156 $ ECHO " ccflags =''$ccflags'" !->vms_cc_type?
157 $ ECHO " ldflags =''$ldflags'"
158 $ ECHO " stdchar=''$stdchar', d_stdstdio=''$d_stdstdio', usevfork=''$usevfork'"
159 $ ECHO " voidflags=''$voidflags', castflags=''$castflags', d_casti32=''$d_casti32', d_castneg=''$d_castneg'"
160 $ ECHO " intsize=''$intsize', alignbytes=''$alignbytes', usemymalloc=''$usemymalloc', randbits=''$randbits'"
163 $ ECHO " libpth=''$libpth'"
164 $ ECHO " libs=''$libs'"
165 $ ECHO " libc=''$libc'"
166 $ ECHO " Dynamic Linking:"
167 $ ECHO " dlsrc=''$dlsrc', dlext=''$dlext', d_dlsymun=''$d_dlsymun'"
168 $ ECHO " cccdlflags=''$cccdlflags', ccdlflags=''$ccdlflags', lddlflags=''$lddlflags'"
171 $ SET DEFAULT 'RATHER_LONG_DEFAULT_DIRECTORY_NAME'