Add copyright notices
[deliverable/binutils-gdb.git] / bfd / configure.com
CommitLineData
252b5132 1$!
11d73275 2$! This file configures the bfd library for use with openVMS.
252b5132
RH
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)
11d73275 8$! Rewritten by Tristan Gingold (gingold@adacore.com)
252b5132 9$!
5bf135a7
NC
10$! Copyright 2012 Free Software Foundation
11$!
12$! This file is free software; you can redistribute it and/or modify
13$! it under the terms of the GNU General Public License as published by
14$! the Free Software Foundation; either version 3 of the License, or
15$! (at your option) any later version.
16$!
17$! This program is distributed in the hope that it will be useful,
18$! but WITHOUT ANY WARRANTY; without even the implied warranty of
19$! MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20$! GNU General Public License for more details.
21$!
22$! You should have received a copy of the GNU General Public License
23$! along with this program; see the file COPYING3. If not see
24$! <http://www.gnu.org/licenses/>.
25$!
11d73275
TG
26$ arch=F$GETSYI("ARCH_NAME")
27$ arch=F$EDIT(arch,"LOWERCASE")
28$if arch .eqs. "alpha" then target = "alpha"
29$if arch .eqs. "ia64" then target = "ia64"
252b5132 30$!
11d73275 31$if (arch .eqs. "alpha") .or. (arch .eqs. "ia64")
252b5132 32$then
11d73275
TG
33$!
34$ write sys$output "Configuring BFD for ''target' target"
35$!
252b5132
RH
36$!
37$! copy bfd-in2.h to bfd.h, replacing @ macros
38$!
39$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
40 []bfd-in2.h /output=[]bfd.h
41$DECK
42!
43! Copy file, changing lines with macros (@@)
44!
45!
11d73275 46 set (success,off);
252b5132
RH
47 vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
48 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
49 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
50 IF match_pos <> 0 THEN;
51 POSITION(BEGINNING_OF(match_pos));
52 ERASE(match_pos);
53 vers := CURRENT_LINE-")";
54 ELSE;
55 vers := "unknown";
56 ENDIF;
57
58 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
59 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
60
61 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
62 IF match_pos <> 0 THEN;
63 POSITION(BEGINNING_OF(match_pos));
64 ERASE(match_pos);
65 COPY_TEXT(vers);
66 ENDIF;
67 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
68 IF match_pos <> 0 THEN;
69 POSITION(BEGINNING_OF(match_pos));
70 ERASE(match_pos);
71 COPY_TEXT('64');
72 ENDIF;
d387240a
TG
73 match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
74 IF match_pos <> 0 THEN;
75 POSITION(BEGINNING_OF(match_pos));
76 ERASE(match_pos);
77 COPY_TEXT('64');
78 ENDIF;
252b5132
RH
79 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
80 IF match_pos <> 0 THEN;
81 POSITION(BEGINNING_OF(match_pos));
82 ERASE(match_pos);
83 COPY_TEXT('0');
84 ENDIF;
d387240a
TG
85 match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang);
86 IF match_pos <> 0 THEN;
87 POSITION(BEGINNING_OF(match_pos));
88 ERASE(match_pos);
545f57c6 89 COPY_TEXT('1');
d387240a
TG
90 ENDIF;
91 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang);
92 IF match_pos <> 0 THEN;
93 POSITION(BEGINNING_OF(match_pos));
94 ERASE(match_pos);
545f57c6 95 COPY_TEXT('1');
d387240a 96 ENDIF;
252b5132
RH
97 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
98 IF match_pos <> 0 THEN;
99 POSITION(BEGINNING_OF(match_pos));
100 ERASE(match_pos);
101 COPY_TEXT('__DECC');
102 SPLIT_LINE;
103 COPY_TEXT('#include <ints.h>');
104 ENDIF;
105 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
106 IF match_pos <> 0 THEN;
107 POSITION(BEGINNING_OF(match_pos));
108 ERASE(match_pos);
109 COPY_TEXT('int64');
110 ENDIF;
111 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
112 IF match_pos <> 0 THEN;
113 POSITION(BEGINNING_OF(match_pos));
114 ERASE(match_pos);
115 COPY_TEXT('uint64');
116 ENDIF;
d387240a
TG
117 match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang);
118 IF match_pos <> 0 THEN;
119 POSITION(BEGINNING_OF(match_pos));
120 ERASE(match_pos);
121 COPY_TEXT('uint64');
122 ENDIF;
123 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
124 IF match_pos <> 0 THEN;
125 POSITION(BEGINNING_OF(match_pos));
126 ERASE(match_pos);
127 COPY_TEXT('bfd_signed_vma');
128 ENDIF;
129 match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang);
130 IF match_pos <> 0 THEN;
131 POSITION(BEGINNING_OF(match_pos));
132 ERASE(match_pos);
133 COPY_TEXT('bfd_vma ufile_ptr');
134 ENDIF;
11d73275
TG
135 match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
136 IF match_pos <> 0 THEN;
137 POSITION(BEGINNING_OF(match_pos));
138 ERASE(match_pos);
139 COPY_TEXT('0');
140 ENDIF;
252b5132
RH
141 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
142 QUIT
143$ EOD
144$
145$else
146$
147$ write sys$output "Configuring for Vax target"
148$ target = "vax"
149$!
150$! copy bfd-in2.h to bfd.h, replacing @ macros
151$!
11d73275 152$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
252b5132
RH
153$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
154 []bfd-in2.h /output=[]bfd.h
155$DECK
156!
157! Copy file, changing lines with macros (@@)
158!
159!
11d73275 160 set (success,off);
252b5132
RH
161 vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
162 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
163 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
164 IF match_pos <> 0 THEN;
165 POSITION(BEGINNING_OF(match_pos));
166 ERASE(match_pos);
167 vers := CURRENT_LINE-")";
168 ELSE;
169 vers := "unknown";
170 ENDIF;
171
172 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
173 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
174
175 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
176 IF match_pos <> 0 THEN;
177 POSITION(BEGINNING_OF(match_pos));
178 ERASE(match_pos);
179 COPY_TEXT(vers);
180 ENDIF;
181 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
182 IF match_pos <> 0 THEN;
183 POSITION(BEGINNING_OF(match_pos));
184 ERASE(match_pos);
185 COPY_TEXT('32');
186 ENDIF;
187 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
188 IF match_pos <> 0 THEN;
189 POSITION(BEGINNING_OF(match_pos));
190 ERASE(match_pos);
191 COPY_TEXT('0');
192 ENDIF;
193 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
194 IF match_pos <> 0 THEN;
195 POSITION(BEGINNING_OF(match_pos));
196 ERASE(match_pos);
197 COPY_TEXT('__DECC');
198 SPLIT_LINE;
199 COPY_TEXT('#include <ints.h>');
200 ENDIF;
201 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
202 IF match_pos <> 0 THEN;
203 POSITION(BEGINNING_OF(match_pos));
204 ERASE(match_pos);
205 COPY_TEXT('int64');
206 ENDIF;
207 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
208 IF match_pos <> 0 THEN;
209 POSITION(BEGINNING_OF(match_pos));
210 ERASE(match_pos);
211 COPY_TEXT('uint64');
212 ENDIF;
213 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
214 QUIT
215$ EOD
216$endif
217$
252b5132 218$!
d387240a
TG
219$! create bfdver.h
220$!
11d73275 221$ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
d387240a
TG
222$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
223 []version.h /output=[]bfdver.h
224$DECK
225!
226! Copy file, changing lines with macros (@@)
227!
228!
11d73275 229 set (success,off);
d387240a
TG
230 vfile := CREATE_BUFFER("vfile", "configure.in");
231 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
232 match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
233 IF match_pos <> 0 THEN;
234 POSITION(BEGINNING_OF(match_pos));
235 ERASE(match_pos);
236 vers := CURRENT_LINE-")";
237 ELSE;
238 vers := "unknown";
239 ENDIF;
240 versnum := vers - "." - ".";
241
242 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
243 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
244
245 match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
246 IF match_pos <> 0 THEN;
247 POSITION(BEGINNING_OF(match_pos));
248 ERASE(match_pos);
249 COPY_TEXT(versnum);
250 ENDIF;
251 match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
252 IF match_pos <> 0 THEN;
253 POSITION(BEGINNING_OF(match_pos));
254 ERASE(match_pos);
255 COPY_TEXT('"');
256 COPY_TEXT(vers);
257 COPY_TEXT('"');
258 ENDIF;
259 match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
260 IF match_pos <> 0 THEN;
261 POSITION(BEGINNING_OF(match_pos));
262 ERASE(match_pos);
263 COPY_TEXT('"(GNU Binutils) "');
264 ENDIF;
265 match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
266 IF match_pos <> 0 THEN;
267 POSITION(BEGINNING_OF(match_pos));
268 ERASE(match_pos);
269 COPY_TEXT('"<http://www.sourceware.org/bugzilla/>"');
270 ENDIF;
271 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
272 QUIT
273$ EOD
d387240a 274$!
252b5132 275$!
083faca9
TG
276$! create bfd_stdint.h
277$!
278$ write sys$output "Generate `bfd_stdint.h'"
279$ create []bfd_stdint.h
280#include <inttypes.h>
281$!
282$!
252b5132
RH
283$! create targmatch.h
284$!
11d73275 285$ write sys$output "Generate `targmatch.h'"
252b5132
RH
286$ open/write tfile []targmatch.h
287$ write tfile "{ """ + target + "-*-*vms*""" + ","
288$ write tfile "#if defined (SELECT_VECS)"
289$ write tfile "SELECT_VECS"
290$ write tfile "#else"
291$ write tfile "UNSUPPORTED_TARGET"
292$ write tfile "#endif"
293$ write tfile "},"
294$ close tfile
252b5132
RH
295$!
296$!
297$! create config.h
298$!
11d73275 299$ write sys$output "Generate `config.h'"
252b5132
RH
300$ create []config.h