2 $! This file configures the bfd library for use with openVMS (Alpha and Vax)
4 $! We do not use the configure script, since we do not have /bin/sh
7 $! Written by Klaus K"ampf (kkaempf@rmi.de)
9 $arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
10 $arch = f$element(arch_indx,"|","|VAX|Alpha|")
12 $if arch .eqs. "Alpha"
14 $ write sys$output "Configuring for Alpha target"
17 $! copy bfd-in2.h to bfd.h, replacing @ macros
19 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
20 []bfd-in2.h /output=[]bfd.h
23 ! Copy file, changing lines with macros (@@)
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));
32 vers := CURRENT_LINE-")";
37 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
38 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
40 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
41 IF match_pos <> 0 THEN;
42 POSITION(BEGINNING_OF(match_pos));
46 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
47 IF match_pos <> 0 THEN;
48 POSITION(BEGINNING_OF(match_pos));
52 match_pos := SEARCH_QUIETLY('@bfd_default_target_size@', FORWARD, EXACT, rang);
53 IF match_pos <> 0 THEN;
54 POSITION(BEGINNING_OF(match_pos));
58 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
59 IF match_pos <> 0 THEN;
60 POSITION(BEGINNING_OF(match_pos));
64 match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang);
65 IF match_pos <> 0 THEN;
66 POSITION(BEGINNING_OF(match_pos));
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));
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));
82 COPY_TEXT('#include <ints.h>');
84 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
85 IF match_pos <> 0 THEN;
86 POSITION(BEGINNING_OF(match_pos));
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));
96 match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang);
97 IF match_pos <> 0 THEN;
98 POSITION(BEGINNING_OF(match_pos));
102 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
103 IF match_pos <> 0 THEN;
104 POSITION(BEGINNING_OF(match_pos));
106 COPY_TEXT('bfd_signed_vma');
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));
112 COPY_TEXT('bfd_vma ufile_ptr');
114 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
120 $ write sys$output "Configuring for Vax target"
123 $! copy bfd-in2.h to bfd.h, replacing @ macros
125 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
126 []bfd-in2.h /output=[]bfd.h
129 ! Copy file, changing lines with macros (@@)
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));
138 vers := CURRENT_LINE-")";
143 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
144 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
146 match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang);
147 IF match_pos <> 0 THEN;
148 POSITION(BEGINNING_OF(match_pos));
152 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
153 IF match_pos <> 0 THEN;
154 POSITION(BEGINNING_OF(match_pos));
158 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
159 IF match_pos <> 0 THEN;
160 POSITION(BEGINNING_OF(match_pos));
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));
170 COPY_TEXT('#include <ints.h>');
172 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
173 IF match_pos <> 0 THEN;
174 POSITION(BEGINNING_OF(match_pos));
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));
184 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
189 $ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
193 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
194 []version.h /output=[]bfdver.h
197 ! Copy file, changing lines with macros (@@)
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));
206 vers := CURRENT_LINE-")";
210 versnum := vers - "." - ".";
212 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
213 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
215 match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
216 IF match_pos <> 0 THEN;
217 POSITION(BEGINNING_OF(match_pos));
221 match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
222 IF match_pos <> 0 THEN;
223 POSITION(BEGINNING_OF(match_pos));
229 match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
230 IF match_pos <> 0 THEN;
231 POSITION(BEGINNING_OF(match_pos));
233 COPY_TEXT('"(GNU Binutils) "');
235 match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
236 IF match_pos <> 0 THEN;
237 POSITION(BEGINNING_OF(match_pos));
239 COPY_TEXT('"<http://www.sourceware.org/bugzilla/>"');
241 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
244 $ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
247 $! create targmatch.h
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"
258 $ write sys$output "Generated `targmatch.h'"
264 /* config.h-vms. Generated by hand by Klaus Kämpf, kkaempf@didymus.rmi.de. */
265 /* config.in. Generated automatically from configure.in by autoheader. */
266 /* Whether malloc must be declared even if <stdlib.h> is included. */
267 /* #undef NEED_DECLARATION_MALLOC */
268 /* Whether free must be declared even if <stdlib.h> is included. */
269 /* #undef NEED_DECLARATION_FREE */
270 /* Define if you have a working `mmap' system call. */
271 /* #define HAVE_MMAP 1 */
272 /* Do we need to use the b modifier when opening binary files? */
273 /* #undef USE_BINARY_FOPEN */
274 /* Name of host specific header file to include in trad-core.c. */
275 /* #undef TRAD_HEADER */
276 /* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
277 /* #undef HAVE_SYS_PROCFS_H */
278 /* Do we really want to use mmap if it's available? */
279 /* #undef USE_MMAP */
280 /* Define if you have the fcntl function. */
282 /* Define if you have the getpagesize function. */
283 #define HAVE_GETPAGESIZE 1
284 /* Define if you have the madvise function. */
285 #define HAVE_MADVISE 1
286 /* Define if you have the mprotect function. */
287 #define HAVE_MPROTECT 1
288 /* Define if you have the <fcntl.h> header file. */
289 #define HAVE_FCNTL_H 1
290 /* Define if you have the <stddef.h> header file. */
291 #define HAVE_STDDEF_H 1
292 /* Define if you have the <stdlib.h> header file. */
293 #define HAVE_STDLIB_H 1
294 /* Define if you have the <string.h> header file. */
295 #define HAVE_STRING_H 1
296 /* Define if you have the <strings.h> header file. */
297 #define HAVE_STRINGS_H 1
298 /* Define if you have the <sys/file.h> header file. */
299 #define HAVE_SYS_FILE_H 1
300 /* Define if you have the <time.h> header file. */
301 #define HAVE_TIME_H 1
302 /* Define if you have the <unistd.h> header file. */
303 #define HAVE_UNISTD_H 1
307 $ write sys$output "Generated `config.h'"