]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blame - bfd/configure.com
PR29348, BFD_VMA_FMT wrong
[thirdparty/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$!
a2c58332 10$! Copyright (C) 2012-2022 Free Software Foundation, Inc.
5bf135a7
NC
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.
1b786873 16$!
5bf135a7
NC
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.
1b786873 21$!
5bf135a7
NC
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
48 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
49 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
50
252b5132
RH
51 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
52 IF match_pos <> 0 THEN;
53 POSITION(BEGINNING_OF(match_pos));
54 ERASE(match_pos);
55 COPY_TEXT('64');
56 ENDIF;
d387240a
TG
57 match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
58 IF match_pos <> 0 THEN;
59 POSITION(BEGINNING_OF(match_pos));
60 ERASE(match_pos);
61 COPY_TEXT('64');
62 ENDIF;
1a5178fe 63 match_pos := SEARCH_QUIETLY('@BFD_INT64_FMT@', FORWARD, EXACT, rang);
252b5132
RH
64 IF match_pos <> 0 THEN;
65 POSITION(BEGINNING_OF(match_pos));
66 ERASE(match_pos);
1a5178fe 67 COPY_TEXT('"l"');
252b5132 68 ENDIF;
d387240a
TG
69 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
70 IF match_pos <> 0 THEN;
71 POSITION(BEGINNING_OF(match_pos));
72 ERASE(match_pos);
73 COPY_TEXT('bfd_signed_vma');
74 ENDIF;
65d13793 75 match_pos := SEARCH_QUIETLY('@bfd_ufile_ptr@', FORWARD, EXACT, rang);
d387240a
TG
76 IF match_pos <> 0 THEN;
77 POSITION(BEGINNING_OF(match_pos));
78 ERASE(match_pos);
65d13793 79 COPY_TEXT('bfd_vma');
d387240a 80 ENDIF;
11d73275
TG
81 match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
82 IF match_pos <> 0 THEN;
83 POSITION(BEGINNING_OF(match_pos));
84 ERASE(match_pos);
85 COPY_TEXT('0');
86 ENDIF;
252b5132
RH
87 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
88 QUIT
89$ EOD
90$
91$else
92$
93$ write sys$output "Configuring for Vax target"
94$ target = "vax"
95$!
96$! copy bfd-in2.h to bfd.h, replacing @ macros
97$!
11d73275 98$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
252b5132
RH
99$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
100 []bfd-in2.h /output=[]bfd.h
101$DECK
102!
103! Copy file, changing lines with macros (@@)
104!
105!
11d73275 106 set (success,off);
252b5132
RH
107
108 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
109 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
110
252b5132
RH
111 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
112 IF match_pos <> 0 THEN;
113 POSITION(BEGINNING_OF(match_pos));
114 ERASE(match_pos);
115 COPY_TEXT('32');
116 ENDIF;
1a5178fe
AM
117 match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
118 IF match_pos <> 0 THEN;
119 POSITION(BEGINNING_OF(match_pos));
120 ERASE(match_pos);
121 COPY_TEXT('32');
122 ENDIF;
123 match_pos := SEARCH_QUIETLY('@BFD_INT64_FMT@', FORWARD, EXACT, rang);
124 IF match_pos <> 0 THEN;
125 POSITION(BEGINNING_OF(match_pos));
126 ERASE(match_pos);
127 COPY_TEXT('"ll"');
128 ENDIF;
129 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
130 IF match_pos <> 0 THEN;
131 POSITION(BEGINNING_OF(match_pos));
132 ERASE(match_pos);
133 COPY_TEXT('bfd_signed_vma');
134 ENDIF;
135 match_pos := SEARCH_QUIETLY('@bfd_ufile_ptr@', FORWARD, EXACT, rang);
136 IF match_pos <> 0 THEN;
137 POSITION(BEGINNING_OF(match_pos));
138 ERASE(match_pos);
139 COPY_TEXT('bfd_vma');
140 ENDIF;
141 match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
252b5132
RH
142 IF match_pos <> 0 THEN;
143 POSITION(BEGINNING_OF(match_pos));
144 ERASE(match_pos);
145 COPY_TEXT('0');
146 ENDIF;
252b5132
RH
147 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
148 QUIT
149$ EOD
150$endif
151$
252b5132 152$!
d387240a
TG
153$! create bfdver.h
154$!
11d73275 155$ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
d387240a
TG
156$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
157 []version.h /output=[]bfdver.h
158$DECK
159!
160! Copy file, changing lines with macros (@@)
161!
162!
11d73275 163 set (success,off);
d387240a
TG
164 vfile := CREATE_BUFFER("vfile", "configure.in");
165 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
787548c8 166 match_pos := SEARCH_QUIETLY('AC_INIT([bfd], [', FORWARD, EXACT, rang);
d387240a
TG
167 IF match_pos <> 0 THEN;
168 POSITION(BEGINNING_OF(match_pos));
169 ERASE(match_pos);
787548c8 170 vers := CURRENT_LINE-"])";
d387240a
TG
171 ELSE;
172 vers := "unknown";
173 ENDIF;
174 versnum := vers - "." - ".";
175
176 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
177 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
178
179 match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
180 IF match_pos <> 0 THEN;
181 POSITION(BEGINNING_OF(match_pos));
182 ERASE(match_pos);
183 COPY_TEXT(versnum);
184 ENDIF;
185 match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
186 IF match_pos <> 0 THEN;
187 POSITION(BEGINNING_OF(match_pos));
188 ERASE(match_pos);
189 COPY_TEXT('"');
190 COPY_TEXT(vers);
191 COPY_TEXT('"');
192 ENDIF;
193 match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
194 IF match_pos <> 0 THEN;
195 POSITION(BEGINNING_OF(match_pos));
196 ERASE(match_pos);
197 COPY_TEXT('"(GNU Binutils) "');
198 ENDIF;
199 match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
200 IF match_pos <> 0 THEN;
201 POSITION(BEGINNING_OF(match_pos));
202 ERASE(match_pos);
eec8bf7e 203 COPY_TEXT('"<https://www.sourceware.org/bugzilla/>"');
d387240a
TG
204 ENDIF;
205 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
206 QUIT
207$ EOD
d387240a 208$!
252b5132
RH
209$!
210$! create targmatch.h
211$!
11d73275 212$ write sys$output "Generate `targmatch.h'"
252b5132
RH
213$ open/write tfile []targmatch.h
214$ write tfile "{ """ + target + "-*-*vms*""" + ","
215$ write tfile "#if defined (SELECT_VECS)"
216$ write tfile "SELECT_VECS"
217$ write tfile "#else"
218$ write tfile "UNSUPPORTED_TARGET"
219$ write tfile "#endif"
220$ write tfile "},"
221$ close tfile
252b5132
RH
222$!
223$!
224$! create config.h
225$!
11d73275 226$ write sys$output "Generate `config.h'"
252b5132
RH
227$ create []config.h
228