Commit | Line | Data |
c07a80fd |
1 | $! #!/bin/sh ---> MYCONFIG.COM |
2 | |
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 |
482b294c |
5 | $! # are requesting help from comp.lang.perl.misc on usenet or via mail. |
c07a80fd |
6 | |
7 | $! DCL-ified by Peter Prymmer <pvhp@lns62.lns.cornell.edu> 22-DEC-1995 |
8 | $! DCL usage (choose one): |
9 | $! @MYCONFIG !or |
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 |
13 | $! version 2: |
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. |
17 | $! Thus if: |
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. |
25 | |
26 | $ ECHO = "WRITE SYS$OUTPUT " |
27 | $ RATHER_LONG_DEFAULT_DIRECTORY_NAME = F$ENVIRONMENT("DEFAULT") |
28 | |
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" |
32 | $ endif |
33 | $Research: |
34 | $ RATHER_LONG_FILENAME_SEARCH = F$Search(RATHER_LONG_FILENAME_TO_FIND) |
35 | $ if RATHER_LONG_FILENAME_SEARCH.EQS."" |
36 | $ then |
37 | $ if f$parse(f$environment("DEFAULT"),,,"DIRECTORY",).NES."[000000]" |
38 | $ then |
39 | $ set default [-] |
40 | $ goto Research |
41 | $ else |
42 | $ ECHO "Can't find the perl config.sh file produced by Configure" |
43 | $ set default 'RATHER_LONG_DEFAULT_DIRECTORY_NAME' |
44 | $! exit 3 |
45 | $ goto cannot_find_config_sh |
46 | $ endif |
47 | $ endif |
48 | |
49 | $ open/read RATHER_LONG_CONFIG_FILE_HANDLE 'RATHER_LONG_FILENAME_SEARCH' |
50 | $Loop: |
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. - |
57 | (name.nes."").and. - |
bf12dbb5 |
58 | (name.nes."'") - !bug in configure.com for osvers='' ? |
c07a80fd |
59 | then $$'name' = "'" + value !$ not necessary but looks more sh-ish |
60 | $ goto Loop |
61 | |
62 | $Done: |
63 | $ close RATHER_LONG_CONFIG_FILE_HANDLE |
64 | $ goto spit_it_out |
65 | |
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 |
77 | |
78 | $! hard-coded stuff (for now): |
79 | $ $cppflags = "'"+"'" !(vestigal) |
80 | $ $optimize = "'"+"'" !descrip.mms has /Optimize=2 in $(XTRACCFLAGS) |
81 | |
bf12dbb5 |
82 | $ $osname = "'"+f$edit(f$getsyi("NODE_SWTYPE"),"COLLAPSE") |
c07a80fd |
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 |
87 | $ endif |
88 | $ $myname = "" |
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") |
bf12dbb5 |
96 | $! Is this same as configure.com ? (spacing/order unknown): |
c07a80fd |
97 | $ $myuname=$osname+" "+$myname+" "+$osvers+" "+F$GetSyi("HW_NAME")+"'" |
98 | $ $osname = $osname+"'" |
99 | $ $osvers = "'"+$osvers+"'" |
100 | |
101 | $look_for_patchlevel_h: |
102 | $! |
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."" |
107 | $ then |
108 | $ if f$parse(f$environment("DEFAULT"),,,"DIRECTORY",).NES."[000000]" |
109 | $ then |
110 | $ set default [-] |
111 | $ goto Research_patchlevel_h |
112 | $ else |
113 | $ ECHO "Can't find the header file patchlevel.h used to make config.sh" |
114 | $ set default 'RATHER_LONG_DEFAULT_DIRECTORY_NAME' |
bf12dbb5 |
115 | $ goto spit_it_out |
c07a80fd |
116 | $ endif |
117 | $ endif |
118 | |
119 | $ open/read RATHER_LONG_CONFIG_FILE_HANDLE 'RATHER_LONG_FILENAME_SEARCH' |
120 | $read_patchlevel_h: |
121 | $ read/end_of_file = patchlevel_h_Done RATHER_LONG_CONFIG_FILE_HANDLE line |
cceca5ed |
122 | $ if f$locate("PERL_VERSION",line).ne.f$length(line) |
c07a80fd |
123 | $ then |
124 | $ line = f$edit(line,"TRIM,COMPRESS") |
125 | $ $PATCHLEVEL = f$element(2," ",line) |
6a6d91dc |
126 | $ if f$type($SUBVERSION).nes."" then goto patchlevel_h_Done |
127 | $ endif |
cceca5ed |
128 | $ if f$locate("PERL_SUBVERSION",line).ne.f$length(line) |
6a6d91dc |
129 | $ then |
130 | $ line = f$edit(line,"TRIM,COMPRESS") |
131 | $ $SUBVERSION = f$element(2," ",line) |
132 | $ if f$type($PATCHLEVEL).nes."" then goto patchlevel_h_Done |
c07a80fd |
133 | $ endif |
134 | $ goto read_patchlevel_h |
135 | |
136 | $patchlevel_h_Done: |
137 | $ close RATHER_LONG_CONFIG_FILE_HANDLE |
138 | $ if $PATCHLEVEL.eqs."" |
139 | $ then |
cceca5ed |
140 | $ echo "warning: PERL_VERSION was not found in ''RATHER_LONG_FILENAME_TO_FIND':" |
c07a80fd |
141 | $ endif |
c07a80fd |
142 | $! |
c07a80fd |
143 | $spit_it_out: |
bf12dbb5 |
144 | $ if (p8.nes."").and.($ld.nes."") then $ld = $ld + " DBG='"+p8+"'" |
c07a80fd |
145 | $! $spitshell = ECHO !<<!GROK!THIS! |
146 | $ ECHO " " |
cceca5ed |
147 | $ ECHO "Summary of my ''$package' (version ''$PATCHLEVEL' subversion ''$SUBVERSION') configuration:" |
c07a80fd |
148 | $ ECHO " Platform:" |
5a5da427 |
149 | $ ECHO " osname=''$osname', osvers=''$osvers', archname=''$archname'" |
c07a80fd |
150 | $ ECHO " uname=''$myuname'" !->d_has_uname? |
6a6d91dc |
151 | $ ECHO " hint=''$hint' d_sigaction='undef'" !->hintfile? |
c07a80fd |
152 | $ ECHO " static exts=''$staticexts'" ! added for VMS |
153 | $ ECHO " Compiler:" |
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'" |
161 | $ ECHO " Libraries:" |
162 | $ ECHO " so=''$so'" |
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'" |
169 | $ ECHO " " |
170 | $ !GROK!THIS! |
171 | $ SET DEFAULT 'RATHER_LONG_DEFAULT_DIRECTORY_NAME' |
172 | $ EXIT |