]> git.ipfire.org Git - thirdparty/binutils-gdb.git/blob - bfd/configure.com
Update year range in copyright notice of binutils files
[thirdparty/binutils-gdb.git] / bfd / configure.com
1 $!
2 $! This file configures the bfd library for use with openVMS.
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 $! Rewritten by Tristan Gingold (gingold@adacore.com)
9 $!
10 $! Copyright (C) 2012-2022 Free Software Foundation, Inc.
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 $!
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"
30 $!
31 $if (arch .eqs. "alpha") .or. (arch .eqs. "ia64")
32 $then
33 $!
34 $ write sys$output "Configuring BFD for ''target' target"
35 $!
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 !
46 set (success,off);
47
48 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
49 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
50
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;
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;
63 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
64 IF match_pos <> 0 THEN;
65 POSITION(BEGINNING_OF(match_pos));
66 ERASE(match_pos);
67 COPY_TEXT('0');
68 ENDIF;
69 match_pos := SEARCH_QUIETLY('@BFD_HOST_LONG_LONG@', FORWARD, EXACT, rang);
70 IF match_pos <> 0 THEN;
71 POSITION(BEGINNING_OF(match_pos));
72 ERASE(match_pos);
73 COPY_TEXT('1');
74 ENDIF;
75 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang);
76 IF match_pos <> 0 THEN;
77 POSITION(BEGINNING_OF(match_pos));
78 ERASE(match_pos);
79 COPY_TEXT('1');
80 ENDIF;
81 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
82 IF match_pos <> 0 THEN;
83 POSITION(BEGINNING_OF(match_pos));
84 ERASE(match_pos);
85 COPY_TEXT('1');
86 ENDIF;
87 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
88 IF match_pos <> 0 THEN;
89 POSITION(BEGINNING_OF(match_pos));
90 ERASE(match_pos);
91 COPY_TEXT('__int64');
92 ENDIF;
93 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
94 IF match_pos <> 0 THEN;
95 POSITION(BEGINNING_OF(match_pos));
96 ERASE(match_pos);
97 COPY_TEXT('unsigned __int64');
98 ENDIF;
99 match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang);
100 IF match_pos <> 0 THEN;
101 POSITION(BEGINNING_OF(match_pos));
102 ERASE(match_pos);
103 COPY_TEXT('unsigned __int64');
104 ENDIF;
105 match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang);
106 IF match_pos <> 0 THEN;
107 POSITION(BEGINNING_OF(match_pos));
108 ERASE(match_pos);
109 COPY_TEXT('bfd_signed_vma');
110 ENDIF;
111 match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang);
112 IF match_pos <> 0 THEN;
113 POSITION(BEGINNING_OF(match_pos));
114 ERASE(match_pos);
115 COPY_TEXT('bfd_vma ufile_ptr');
116 ENDIF;
117 match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
118 IF match_pos <> 0 THEN;
119 POSITION(BEGINNING_OF(match_pos));
120 ERASE(match_pos);
121 COPY_TEXT('0');
122 ENDIF;
123 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
124 QUIT
125 $ EOD
126 $
127 $else
128 $
129 $ write sys$output "Configuring for Vax target"
130 $ target = "vax"
131 $!
132 $! copy bfd-in2.h to bfd.h, replacing @ macros
133 $!
134 $ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
135 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
136 []bfd-in2.h /output=[]bfd.h
137 $DECK
138 !
139 ! Copy file, changing lines with macros (@@)
140 !
141 !
142 set (success,off);
143
144 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
145 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
146
147 match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang);
148 IF match_pos <> 0 THEN;
149 POSITION(BEGINNING_OF(match_pos));
150 ERASE(match_pos);
151 COPY_TEXT('32');
152 ENDIF;
153 match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang);
154 IF match_pos <> 0 THEN;
155 POSITION(BEGINNING_OF(match_pos));
156 ERASE(match_pos);
157 COPY_TEXT('0');
158 ENDIF;
159 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
160 IF match_pos <> 0 THEN;
161 POSITION(BEGINNING_OF(match_pos));
162 ERASE(match_pos);
163 COPY_TEXT('__DECC');
164 SPLIT_LINE;
165 COPY_TEXT('#include <ints.h>');
166 ENDIF;
167 match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang);
168 IF match_pos <> 0 THEN;
169 POSITION(BEGINNING_OF(match_pos));
170 ERASE(match_pos);
171 COPY_TEXT('int64');
172 ENDIF;
173 match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang);
174 IF match_pos <> 0 THEN;
175 POSITION(BEGINNING_OF(match_pos));
176 ERASE(match_pos);
177 COPY_TEXT('uint64');
178 ENDIF;
179 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
180 QUIT
181 $ EOD
182 $endif
183 $
184 $!
185 $! create bfdver.h
186 $!
187 $ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
188 $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
189 []version.h /output=[]bfdver.h
190 $DECK
191 !
192 ! Copy file, changing lines with macros (@@)
193 !
194 !
195 set (success,off);
196 vfile := CREATE_BUFFER("vfile", "configure.in");
197 rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
198 match_pos := SEARCH_QUIETLY('AC_INIT([bfd], [', FORWARD, EXACT, rang);
199 IF match_pos <> 0 THEN;
200 POSITION(BEGINNING_OF(match_pos));
201 ERASE(match_pos);
202 vers := CURRENT_LINE-"])";
203 ELSE;
204 vers := "unknown";
205 ENDIF;
206 versnum := vers - "." - ".";
207
208 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
209 rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file));
210
211 match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang);
212 IF match_pos <> 0 THEN;
213 POSITION(BEGINNING_OF(match_pos));
214 ERASE(match_pos);
215 COPY_TEXT(versnum);
216 ENDIF;
217 match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang);
218 IF match_pos <> 0 THEN;
219 POSITION(BEGINNING_OF(match_pos));
220 ERASE(match_pos);
221 COPY_TEXT('"');
222 COPY_TEXT(vers);
223 COPY_TEXT('"');
224 ENDIF;
225 match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang);
226 IF match_pos <> 0 THEN;
227 POSITION(BEGINNING_OF(match_pos));
228 ERASE(match_pos);
229 COPY_TEXT('"(GNU Binutils) "');
230 ENDIF;
231 match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang);
232 IF match_pos <> 0 THEN;
233 POSITION(BEGINNING_OF(match_pos));
234 ERASE(match_pos);
235 COPY_TEXT('"<https://www.sourceware.org/bugzilla/>"');
236 ENDIF;
237 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
238 QUIT
239 $ EOD
240 $!
241 $!
242 $! create targmatch.h
243 $!
244 $ write sys$output "Generate `targmatch.h'"
245 $ open/write tfile []targmatch.h
246 $ write tfile "{ """ + target + "-*-*vms*""" + ","
247 $ write tfile "#if defined (SELECT_VECS)"
248 $ write tfile "SELECT_VECS"
249 $ write tfile "#else"
250 $ write tfile "UNSUPPORTED_TARGET"
251 $ write tfile "#endif"
252 $ write tfile "},"
253 $ close tfile
254 $!
255 $!
256 $! create config.h
257 $!
258 $ write sys$output "Generate `config.h'"
259 $ create []config.h
260 /* config.h-vms. Generated by hand by Klaus Kämpf, kkaempf@didymus.rmi.de. */
261 /* config.in. Generated automatically from configure.in by autoheader. */
262 /* Whether malloc must be declared even if <stdlib.h> is included. */
263 /* #undef NEED_DECLARATION_MALLOC */
264 /* Whether free must be declared even if <stdlib.h> is included. */
265 /* #undef NEED_DECLARATION_FREE */
266 /* Define if you have a working `mmap' system call. */
267 /* #define HAVE_MMAP 1 */
268 /* Do we need to use the b modifier when opening binary files? */
269 /* #undef USE_BINARY_FOPEN */
270 /* Name of host specific header file to include in trad-core.c. */
271 /* #undef TRAD_HEADER */
272 /* Define only if <sys/procfs.h> is available *and* it defines prstatus_t. */
273 /* #undef HAVE_SYS_PROCFS_H */
274 /* Do we really want to use mmap if it's available? */
275 /* #undef USE_MMAP */
276 /* Define if you have the fcntl function. */
277 #define HAVE_FCNTL 1
278 /* Define if you have the getpagesize function. */
279 #define HAVE_GETPAGESIZE 1
280 /* Define if you have the madvise function. */
281 #define HAVE_MADVISE 1
282 /* Define if you have the mprotect function. */
283 #define HAVE_MPROTECT 1
284 /* Define if you have the <fcntl.h> header file. */
285 #define HAVE_FCNTL_H 1
286 /* Define if you have the <stddef.h> header file. */
287 #define HAVE_STDDEF_H 1
288 /* Define if you have the <stdlib.h> header file. */
289 #define HAVE_STDLIB_H 1
290 /* Define if you have the <string.h> header file. */
291 #define HAVE_STRING_H 1
292 /* Define if you have the <strings.h> header file. */
293 #define HAVE_STRINGS_H 1
294 /* Define if you have the <sys/file.h> header file. */
295 #define HAVE_SYS_FILE_H 1
296 /* Define if you have the <time.h> header file. */
297 #define HAVE_TIME_H 1
298 /* Define if you have the <unistd.h> header file. */
299 #define HAVE_UNISTD_H 1
300 /* Disable NLS */
301 #undef ENABLE_NLS
302 /* Name of package */
303 #define PACKAGE "bfd"
304 /* Define to the address where bug reports for this package should be sent. */
305 #define PACKAGE_BUGREPORT ""
306 /* Define to the full name of this package. */
307 #define PACKAGE_NAME "bfd"
308 /* Define to the full name and version of this package. */
309 #define PACKAGE_STRING "bfd"
310 /* Define to the one symbol short name of this package. */
311 #define PACKAGE_TARNAME "bfd"
312 /* Define to the home page for this package. */
313 #define PACKAGE_URL ""
314 /* Define to the version of this package. */
315 #define PACKAGE_VERSION "(package version)"
316 $!
317 $ write sys$output "Copy sysdep.h"
318 $ copy [.hosts]alphavms.h sysdep.h
319 $
320 $ write sys$output "Generate build.com"
321 $!
322 $ if ARCH.eqs."alpha"
323 $ then
324 $ create build.com
325 $DECK
326 $ DEFS="""SELECT_VECS=&alpha_vms_vec"","+-
327 """SELECT_ARCHITECTURES=&bfd_alpha_arch"""
328 $ FILES="cpu-alpha,vms,vms-hdr,vms-gsd,vms-tir,vms-misc,"
329 $EOD
330 $ endif
331 $ if ARCH.eqs."ia64"
332 $ then
333 $ create build.com
334 $DECK
335 $ DEFS="""SELECT_VECS=&ia64_elf64_vms_vec"","+-
336 """SELECT_ARCHITECTURES=&bfd_ia64_arch"""
337 $ FILES="cpu-ia64,elf64-ia64,elf-strtab,corefile,stabs,merge,elf-eh-frame,"+-
338 "elflink,elf-attrs,dwarf1,elf64,"
339 $EOD
340 $ create substxx.tpu
341 $DECK
342 set (success,off);
343 file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
344 found_range := CREATE_RANGE(BEGINNING_OF(file), BEGINNING_OF(file));
345
346 LOOP
347 rang := CREATE_RANGE (END_OF(found_range),END_OF(file));
348 match_pos := SEARCH_QUIETLY('NN', FORWARD, EXACT, rang);
349 EXITIF match_pos = 0;
350 POSITION(BEGINNING_OF(match_pos));
351 ERASE(match_pos);
352 COPY_TEXT('64');
353 ENDLOOP;
354 WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
355 QUIT
356 $ EOD
357 $ write sys$output "Generate elf64-target.h from elfxx-target.h"
358 $ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
359 []elfXX-target.h /output=[]elf64-target.h
360 $ del substxx.tpu;*
361 $ endif
362 $ append sys$input build.com
363 $DECK
364 $ DEFS=DEFS + ",""unlink=remove"",""DEBUGDIR=""""GNU$DEBUGDIR:"""""""
365 $ OPT="/noopt/debug"
366 $ CFLAGS="/name=(as_is,shortened)" + -
367 "/include=([],""../"",""../include"")" + -
368 "/define=(" + DEFS + ")" + OPT
369 $ FILES=FILES + "archive,archive64,archures,bfd,bfdio,binary,cache,coffgen,"+-
370 "compress,corefile,dwarf2,elf,format,hash,ihex,init,libbfd,linker,"+-
371 "opncls,reloc,section,simple,srec,stab-syms,syms,targets,tekhex,verilog"
372 $ write sys$output "CFLAGS=",CFLAGS
373 $ cflags_libbfd="/warning=(disable=missingreturn)"
374 $ cflags_nil=""
375 $ NUM = 0
376 $ OBJS=""
377 $ LOOP:
378 $ F = F$ELEMENT(NUM,",",FILES)
379 $ IF F.EQS."," THEN GOTO END
380 $ eflags_name="cflags_''f'"
381 $ name_len=f$length(eflags_name)
382 $ dash_pos=f$locate("-",eflags_name)
383 $ if dash_pos.ne.name_len
384 $ then
385 $ eflags_name['dash_pos,1]:="_"
386 $ dash_pos=f$locate("-",eflags_name)
387 $ if dash_pos.ne.name_len then eflags_name['dash_pos,1]:="_"
388 $ endif
389 $ if f$type('eflags_name).eqs."" then eflags_name="cflags_nil"
390 $ eflags='eflags_name
391 $ write sys$output "Compiling ", F, ".c", eflags
392 $ cc 'CFLAGS 'eflags 'F.c
393 $ IF OBJS.NES."" THEN OBJS=OBJS + ","
394 $ OBJS=OBJS + F + ".obj"
395 $ NUM = NUM + 1
396 $ GOTO LOOP
397 $ END:
398 $ purge
399 $ lib/create libbfd 'OBJS
400 $EOD