daily update
[deliverable/binutils-gdb.git] / bfd / configure.com
CommitLineData
252b5132
RH
1$!
2$! This file configures the bfd library for use with openVMS (Alpha and Vax)
3$!
4$! We do not use the configure script, since we do not have /bin/sh
5$! to execute it.
6$!
7$! Written by Klaus K"ampf (kkaempf@rmi.de)
8$!
9$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
10$arch = f$element(arch_indx,"|","|VAX|Alpha|")
11$!
12$if arch .eqs. "Alpha"
13$then
14$ write sys$output "Configuring for Alpha target"
15$ target = "alpha"
16$!
17$! copy bfd-in2.h to bfd.h, replacing @ macros
18$!
19$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
20 []bfd-in2.h /output=[]bfd.h
21$DECK
22!
23! Copy file, changing lines with macros (@@)
24!
25!
26 vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
27 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
28 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
29 IF match_pos <> 0 THEN;
30 POSITION(BEGINNING_OF(match_pos));
31 ERASE(match_pos);
32 vers := CURRENT_LINE-")";
33 ELSE;
34 vers := "unknown";
35 ENDIF;
36
37 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
38 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
39
40 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
41 IF match_pos <> 0 THEN;
42 POSITION(BEGINNING_OF(match_pos));
43 ERASE(match_pos);
44 COPY_TEXT(vers);
45 ENDIF;
46 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
47 IF match_pos <> 0 THEN;
48 POSITION(BEGINNING_OF(match_pos));
49 ERASE(match_pos);
50 COPY_TEXT('64');
51 ENDIF;
d387240a
TG
52 match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
53 IF match_pos <> 0 THEN;
54 POSITION(BEGINNING_OF(match_pos));
55 ERASE(match_pos);
56 COPY_TEXT('64');
57 ENDIF;
252b5132
RH
58 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
59 IF match_pos <> 0 THEN;
60 POSITION(BEGINNING_OF(match_pos));
61 ERASE(match_pos);
62 COPY_TEXT('0');
63 ENDIF;
d387240a
TG
64 match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang);
65 IF match_pos <> 0 THEN;
66 POSITION(BEGINNING_OF(match_pos));
67 ERASE(match_pos);
68 COPY_TEXT('0');
69 ENDIF;
70 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang);
71 IF match_pos <> 0 THEN;
72 POSITION(BEGINNING_OF(match_pos));
73 ERASE(match_pos);
74 COPY_TEXT('0');
75 ENDIF;
252b5132
RH
76 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
77 IF match_pos <> 0 THEN;
78 POSITION(BEGINNING_OF(match_pos));
79 ERASE(match_pos);
80 COPY_TEXT('__DECC');
81 SPLIT_LINE;
82 COPY_TEXT('#include <ints.h>');
83 ENDIF;
84 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
85 IF match_pos <> 0 THEN;
86 POSITION(BEGINNING_OF(match_pos));
87 ERASE(match_pos);
88 COPY_TEXT('int64');
89 ENDIF;
90 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
91 IF match_pos <> 0 THEN;
92 POSITION(BEGINNING_OF(match_pos));
93 ERASE(match_pos);
94 COPY_TEXT('uint64');
95 ENDIF;
d387240a
TG
96 match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang);
97 IF match_pos <> 0 THEN;
98 POSITION(BEGINNING_OF(match_pos));
99 ERASE(match_pos);
100 COPY_TEXT('uint64');
101 ENDIF;
102 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
103 IF match_pos <> 0 THEN;
104 POSITION(BEGINNING_OF(match_pos));
105 ERASE(match_pos);
106 COPY_TEXT('bfd_signed_vma');
107 ENDIF;
108 match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang);
109 IF match_pos <> 0 THEN;
110 POSITION(BEGINNING_OF(match_pos));
111 ERASE(match_pos);
112 COPY_TEXT('bfd_vma ufile_ptr');
113 ENDIF;
252b5132
RH
114 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
115 QUIT
116$ EOD
117$
118$else
119$
120$ write sys$output "Configuring for Vax target"
121$ target = "vax"
122$!
123$! copy bfd-in2.h to bfd.h, replacing @ macros
124$!
125$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
126 []bfd-in2.h /output=[]bfd.h
127$DECK
128!
129! Copy file, changing lines with macros (@@)
130!
131!
132 vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
133 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
134 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
135 IF match_pos <> 0 THEN;
136 POSITION(BEGINNING_OF(match_pos));
137 ERASE(match_pos);
138 vers := CURRENT_LINE-")";
139 ELSE;
140 vers := "unknown";
141 ENDIF;
142
143 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
144 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
145
146 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
147 IF match_pos <> 0 THEN;
148 POSITION(BEGINNING_OF(match_pos));
149 ERASE(match_pos);
150 COPY_TEXT(vers);
151 ENDIF;
152 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
153 IF match_pos <> 0 THEN;
154 POSITION(BEGINNING_OF(match_pos));
155 ERASE(match_pos);
156 COPY_TEXT('32');
157 ENDIF;
158 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
159 IF match_pos <> 0 THEN;
160 POSITION(BEGINNING_OF(match_pos));
161 ERASE(match_pos);
162 COPY_TEXT('0');
163 ENDIF;
164 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
165 IF match_pos <> 0 THEN;
166 POSITION(BEGINNING_OF(match_pos));
167 ERASE(match_pos);
168 COPY_TEXT('__DECC');
169 SPLIT_LINE;
170 COPY_TEXT('#include <ints.h>');
171 ENDIF;
172 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
173 IF match_pos <> 0 THEN;
174 POSITION(BEGINNING_OF(match_pos));
175 ERASE(match_pos);
176 COPY_TEXT('int64');
177 ENDIF;
178 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
179 IF match_pos <> 0 THEN;
180 POSITION(BEGINNING_OF(match_pos));
181 ERASE(match_pos);
182 COPY_TEXT('uint64');
183 ENDIF;
184 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
185 QUIT
186$ EOD
187$endif
188$
189$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
190$!
d387240a
TG
191$! create bfdver.h
192$!
193$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
194 []version.h /output=[]bfdver.h
195$DECK
196!
197! Copy file, changing lines with macros (@@)
198!
199!
200 vfile := CREATE_BUFFER("vfile", "configure.in");
201 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
202 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
203 IF match_pos <> 0 THEN;
204 POSITION(BEGINNING_OF(match_pos));
205 ERASE(match_pos);
206 vers := CURRENT_LINE-")";
207 ELSE;
208 vers := "unknown";
209 ENDIF;
210 versnum := vers - "." - ".";
211
212 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
213 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
214
215 match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
216 IF match_pos <> 0 THEN;
217 POSITION(BEGINNING_OF(match_pos));
218 ERASE(match_pos);
219 COPY_TEXT(versnum);
220 ENDIF;
221 match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
222 IF match_pos <> 0 THEN;
223 POSITION(BEGINNING_OF(match_pos));
224 ERASE(match_pos);
225 COPY_TEXT('"');
226 COPY_TEXT(vers);
227 COPY_TEXT('"');
228 ENDIF;
229 match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
230 IF match_pos <> 0 THEN;
231 POSITION(BEGINNING_OF(match_pos));
232 ERASE(match_pos);
233 COPY_TEXT('"(GNU Binutils) "');
234 ENDIF;
235 match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
236 IF match_pos <> 0 THEN;
237 POSITION(BEGINNING_OF(match_pos));
238 ERASE(match_pos);
239 COPY_TEXT('"<http://www.sourceware.org/bugzilla/>"');
240 ENDIF;
241 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
242 QUIT
243$ EOD
244$ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
245$!
252b5132
RH
246$!
247$! create targmatch.h
248$!
249$ open/write tfile []targmatch.h
250$ write tfile "{ """ + target + "-*-*vms*""" + ","
251$ write tfile "#if defined (SELECT_VECS)"
252$ write tfile "SELECT_VECS"
253$ write tfile "#else"
254$ write tfile "UNSUPPORTED_TARGET"
255$ write tfile "#endif"
256$ write tfile "},"
257$ close tfile
258$ write sys$output "Generated `targmatch.h'"
259$!
260$!
261$! create config.h
262$!
263$ create []config.h