1
1
$!
2
- $! This file configures the bfd library for use with openVMS (Alpha and Vax)
2
+ $! This file configures the bfd library for use with openVMS.
3
3
$!
4
4
$! We do not use the configure script, since we do not have /bin/sh
5
5
$! to execute it.
6
6
$!
7
7
$! Written by Klaus K"ampf (
[email protected] )
8
+ $! Rewritten by Tristan Gingold (
[email protected] )
8
9
$!
9
- $arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
10
- $arch = f$element(arch_indx,"|","|VAX|Alpha|")
10
+ $ arch=F$GETSYI("ARCH_NAME")
11
+ $ arch=F$EDIT(arch,"LOWERCASE")
12
+ $if arch .eqs. "alpha" then target = "alpha"
13
+ $if arch .eqs. "ia64" then target = "ia64"
11
14
$!
12
- $if arch .eqs. "Alpha"
15
+ $if ( arch .eqs. "alpha") .or. (arch .eqs. "ia64")
13
16
$then
14
- $ write sys$output "Configuring for Alpha target"
15
- $ target = "alpha"
17
+ $!
18
+ $ write sys$output "Configuring BFD for ''target' target"
19
+ $!
16
20
$!
17
21
$! copy bfd-in2.h to bfd.h, replacing @ macros
18
22
$!
23
27
! Copy file, changing lines with macros (@@)
24
28
!
25
29
!
30
+ set (success,off);
26
31
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
27
32
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
28
33
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -111,6 +116,12 @@ $DECK
111
116
ERASE(match_pos);
112
117
COPY_TEXT('bfd_vma ufile_ptr');
113
118
ENDIF;
119
+ match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
120
+ IF match_pos <> 0 THEN;
121
+ POSITION(BEGINNING_OF(match_pos));
122
+ ERASE(match_pos);
123
+ COPY_TEXT('0');
124
+ ENDIF;
114
125
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
115
126
QUIT
116
127
$ EOD
@@ -122,13 +133,15 @@ $ target = "vax"
122
133
$!
123
134
$! copy bfd-in2.h to bfd.h, replacing @ macros
124
135
$!
136
+ $ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
125
137
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
126
138
[]bfd-in2.h /output=[]bfd.h
127
139
$DECK
128
140
!
129
141
! Copy file, changing lines with macros (@@)
130
142
!
131
143
!
144
+ set (success,off);
132
145
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
133
146
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
134
147
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -186,17 +199,18 @@ $DECK
186
199
$ EOD
187
200
$endif
188
201
$
189
- $ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
190
202
$!
191
203
$! create bfdver.h
192
204
$!
205
+ $ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
193
206
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
194
207
[]version.h /output=[]bfdver.h
195
208
$DECK
196
209
!
197
210
! Copy file, changing lines with macros (@@)
198
211
!
199
212
!
213
+ set (success,off);
200
214
vfile := CREATE_BUFFER("vfile", "configure.in");
201
215
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
202
216
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
@@ -241,11 +255,11 @@ $DECK
241
255
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
242
256
QUIT
243
257
$ EOD
244
- $ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
245
258
$!
246
259
$!
247
260
$! create targmatch.h
248
261
$!
262
+ $ write sys$output "Generate `targmatch.h'"
249
263
$ open/write tfile []targmatch.h
250
264
$ write tfile "{ """ + target + "-*-*vms*""" + ","
251
265
$ write tfile "#if defined (SELECT_VECS)"
@@ -255,11 +269,11 @@ $ write tfile "UNSUPPORTED_TARGET"
255
269
$ write tfile "#endif"
256
270
$ write tfile "},"
257
271
$ close tfile
258
- $ write sys$output "Generated `targmatch.h'"
259
272
$!
260
273
$!
261
274
$! create config.h
262
275
$!
276
+ $ write sys$output "Generate `config.h'"
263
277
$ create []config.h
264
278
/* config.h-vms. Generated by hand by Klaus K�mpf,
[email protected] . */
265
279
/* config.in. Generated automatically from configure.in by autoheader. */
@@ -304,5 +318,88 @@ $ create []config.h
304
318
/* Disable NLS */
305
319
#undef ENABLE_NLS
306
320
$!
307
- $ write sys$output "Generated `config.h'"
321
+ $ write sys$output "Generate build.com"
322
+ $!
323
+ $ if ARCH.eqs."alpha"
324
+ $ then
325
+ $ create build.com
326
+ $DECK
327
+ $ DEFS="""SELECT_VECS=&vms_alpha_vec"","+-
328
+ """SELECT_ARCHITECTURES=&bfd_alpha_arch"""
329
+ $ FILES="cpu-alpha,vms,vms-hdr,vms-gsd,vms-tir,vms-misc,"
330
+ $EOD
331
+ $ endif
332
+ $ if ARCH.eqs."ia64"
333
+ $ then
334
+ $ create build.com
335
+ $DECK
336
+ $ DEFS="""SELECT_VECS=&bfd_elf64_ia64_vms_vec"","+-
337
+ """SELECT_ARCHITECTURES=&bfd_ia64_arch"""
338
+ $ FILES="cpu-ia64,elf64-ia64,elf-strtab,corefile,stabs,merge,elf-eh-frame,"+-
339
+ "elflink,elf-attrs,dwarf1,elf64,"
340
+ $EOD
341
+ $ create substxx.tpu
342
+ $DECK
343
+ set (success,off);
344
+ file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
345
+ found_range := CREATE_RANGE(BEGINNING_OF(file), BEGINNING_OF(file));
308
346
347
+ LOOP
348
+ rang := CREATE_RANGE (END_OF(found_range),END_OF(file));
349
+ match_pos := SEARCH_QUIETLY('NN', FORWARD, EXACT, rang);
350
+ EXITIF match_pos = 0;
351
+ POSITION(BEGINNING_OF(match_pos));
352
+ ERASE(match_pos);
353
+ COPY_TEXT('64');
354
+ ENDLOOP;
355
+ WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
356
+ QUIT
357
+ $ EOD
358
+ $ write sys$output "Generate elf64-ia64.c from elfxx-ia64.c"
359
+ $ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
360
+ []elfXX-ia64.c /output=[]elf64-ia64.c
361
+ $ write sys$output "Generate elf64-target.h from elfxx-target.h"
362
+ $ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
363
+ []elfXX-target.h /output=[]elf64-target.h
364
+ $ del substxx.tpu;*
365
+ $ copy [.hosts]alphavms.h sysdep.h
366
+ $ endif
367
+ $ append sys$input build.com
368
+ $DECK
369
+ $ DEFS=DEFS + ",""unlink=remove"",""DEBUGDIR=""""GNU$DEBUGDIR:"""""""
370
+ $ OPT="/noopt/debug"
371
+ $ CFLAGS="/name=(as_is,shortened)" + -
372
+ "/include=([],""../"",""../include"")" + -
373
+ "/define=(" + DEFS + ")" + OPT
374
+ $ FILES=FILES + "archive,archive64,archures,bfd,bfdio,binary,cache,coffgen,"+-
375
+ "compress,corefile,dwarf2,elf,format,hash,ihex,init,libbfd,linker,"+-
376
+ "opncls,reloc,section,simple,srec,stab-syms,syms,targets,tekhex,verilog"
377
+ $ write sys$output "CFLAGS=",CFLAGS
378
+ $ cflags_libbfd="/warning=(disable=missingreturn)"
379
+ $ cflags_nil=""
380
+ $ NUM = 0
381
+ $ OBJS=""
382
+ $ LOOP:
383
+ $ F = F$ELEMENT(NUM,",",FILES)
384
+ $ IF F.EQS."," THEN GOTO END
385
+ $ eflags_name="cflags_''f'"
386
+ $ name_len=f$length(eflags_name)
387
+ $ dash_pos=f$locate("-",eflags_name)
388
+ $ if dash_pos.ne.name_len
389
+ $ then
390
+ $ eflags_name['dash_pos,1]:="_"
391
+ $ dash_pos=f$locate("-",eflags_name)
392
+ $ if dash_pos.ne.name_len then eflags_name['dash_pos,1]:="_"
393
+ $ endif
394
+ $ if f$type('eflags_name).eqs."" then eflags_name="cflags_nil"
395
+ $ eflags='eflags_name
396
+ $ write sys$output "Compiling ", F, ".c", eflags
397
+ $ cc 'CFLAGS 'eflags 'F.c
398
+ $ IF OBJS.NES."" THEN OBJS=OBJS + ","
399
+ $ OBJS=OBJS + F + ".obj"
400
+ $ NUM = NUM + 1
401
+ $ GOTO LOOP
402
+ $ END:
403
+ $ purge
404
+ $ lib/create libbfd 'OBJS
405
+ $EOD
0 commit comments