$!
-$! This file configures the bfd library for use with openVMS (Alpha and Vax)
+$! This file configures the bfd library for use with openVMS.
$!
$! We do not use the configure script, since we do not have /bin/sh
$! to execute it.
$!
$! Written by Klaus K"ampf (kkaempf@rmi.de)
+$! Rewritten by Tristan Gingold (gingold@adacore.com)
$!
-$arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2
-$arch = f$element(arch_indx,"|","|VAX|Alpha|")
+$ arch=F$GETSYI("ARCH_NAME")
+$ arch=F$EDIT(arch,"LOWERCASE")
+$if arch .eqs. "alpha" then target = "alpha"
+$if arch .eqs. "ia64" then target = "ia64"
$!
-$if arch .eqs. "Alpha"
+$if (arch .eqs. "alpha") .or. (arch .eqs. "ia64")
$then
-$ write sys$output "Configuring for Alpha target"
-$ target = "alpha"
+$!
+$ write sys$output "Configuring BFD for ''target' target"
+$!
$!
$! copy bfd-in2.h to bfd.h, replacing @ macros
$!
! Copy file, changing lines with macros (@@)
!
!
+ set (success,off);
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
IF match_pos <> 0 THEN;
POSITION(BEGINNING_OF(match_pos));
ERASE(match_pos);
- COPY_TEXT('0');
+ COPY_TEXT('1');
ENDIF;
match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG_LONG@', FORWARD, EXACT, rang);
IF match_pos <> 0 THEN;
POSITION(BEGINNING_OF(match_pos));
ERASE(match_pos);
- COPY_TEXT('0');
+ COPY_TEXT('1');
ENDIF;
match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang);
IF match_pos <> 0 THEN;
ERASE(match_pos);
COPY_TEXT('bfd_vma ufile_ptr');
ENDIF;
+ match_pos := SEARCH_QUIETLY('@supports_plugins@', FORWARD, EXACT, rang);
+ IF match_pos <> 0 THEN;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('0');
+ ENDIF;
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
QUIT
$ EOD
$!
$! copy bfd-in2.h to bfd.h, replacing @ macros
$!
+$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
[]bfd-in2.h /output=[]bfd.h
$DECK
! Copy file, changing lines with macros (@@)
!
!
+ set (success,off);
vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN");
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
$ EOD
$endif
$
-$ write sys$output "Generated `bfd.h' from `bfd-in2.h'."
$!
$! create bfdver.h
$!
+$ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'."
$ edit/tpu/nojournal/nosection/nodisplay/command=sys$input -
[]version.h /output=[]bfdver.h
$DECK
! Copy file, changing lines with macros (@@)
!
!
+ set (success,off);
vfile := CREATE_BUFFER("vfile", "configure.in");
rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile));
match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang);
WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
QUIT
$ EOD
-$ write sys$output "Generated `bfdver.h' from 'version.h' and `configure.in'."
+$!
+$!
+$! create bfd_stdint.h
+$!
+$ write sys$output "Generate `bfd_stdint.h'"
+$ create []bfd_stdint.h
+#include <inttypes.h>
$!
$!
$! create targmatch.h
$!
+$ write sys$output "Generate `targmatch.h'"
$ open/write tfile []targmatch.h
$ write tfile "{ """ + target + "-*-*vms*""" + ","
$ write tfile "#if defined (SELECT_VECS)"
$ write tfile "#endif"
$ write tfile "},"
$ close tfile
-$ write sys$output "Generated `targmatch.h'"
$!
$!
$! create config.h
$!
+$ write sys$output "Generate `config.h'"
$ create []config.h
/* config.h-vms. Generated by hand by Klaus Kämpf, kkaempf@didymus.rmi.de. */
/* config.in. Generated automatically from configure.in by autoheader. */
/* Disable NLS */
#undef ENABLE_NLS
$!
-$ write sys$output "Generated `config.h'"
+$ write sys$output "Copy sysdep.h"
+$ copy [.hosts]alphavms.h sysdep.h
+$
+$ write sys$output "Generate build.com"
+$!
+$ if ARCH.eqs."alpha"
+$ then
+$ create build.com
+$DECK
+$ DEFS="""SELECT_VECS=&vms_alpha_vec"","+-
+ """SELECT_ARCHITECTURES=&bfd_alpha_arch"""
+$ FILES="cpu-alpha,vms,vms-hdr,vms-gsd,vms-tir,vms-misc,"
+$EOD
+$ endif
+$ if ARCH.eqs."ia64"
+$ then
+$ create build.com
+$DECK
+$ DEFS="""SELECT_VECS=&bfd_elf64_ia64_vms_vec"","+-
+ """SELECT_ARCHITECTURES=&bfd_ia64_arch"""
+$ FILES="cpu-ia64,elf64-ia64,elf-strtab,corefile,stabs,merge,elf-eh-frame,"+-
+ "elflink,elf-attrs,dwarf1,elf64,"
+$EOD
+$ create substxx.tpu
+$DECK
+ set (success,off);
+ file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name"));
+ found_range := CREATE_RANGE(BEGINNING_OF(file), BEGINNING_OF(file));
+ LOOP
+ rang := CREATE_RANGE (END_OF(found_range),END_OF(file));
+ match_pos := SEARCH_QUIETLY('NN', FORWARD, EXACT, rang);
+ EXITIF match_pos = 0;
+ POSITION(BEGINNING_OF(match_pos));
+ ERASE(match_pos);
+ COPY_TEXT('64');
+ ENDLOOP;
+ WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file"));
+ QUIT
+$ EOD
+$ write sys$output "Generate elf64-ia64.c from elfxx-ia64.c"
+$ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
+ []elfXX-ia64.c /output=[]elf64-ia64.c
+$ write sys$output "Generate elf64-target.h from elfxx-target.h"
+$ edit/tpu/nojournal/nosection/nodisplay/command=substxx.tpu -
+ []elfXX-target.h /output=[]elf64-target.h
+$ del substxx.tpu;*
+$ endif
+$ append sys$input build.com
+$DECK
+$ DEFS=DEFS + ",""unlink=remove"",""DEBUGDIR=""""GNU$DEBUGDIR:"""""""
+$ OPT="/noopt/debug"
+$ CFLAGS="/name=(as_is,shortened)" + -
+ "/include=([],""../"",""../include"")" + -
+ "/define=(" + DEFS + ")" + OPT
+$ FILES=FILES + "archive,archive64,archures,bfd,bfdio,binary,cache,coffgen,"+-
+ "compress,corefile,dwarf2,elf,format,hash,ihex,init,libbfd,linker,"+-
+ "opncls,reloc,section,simple,srec,stab-syms,syms,targets,tekhex,verilog"
+$ write sys$output "CFLAGS=",CFLAGS
+$ cflags_libbfd="/warning=(disable=missingreturn)"
+$ cflags_nil=""
+$ NUM = 0
+$ OBJS=""
+$ LOOP:
+$ F = F$ELEMENT(NUM,",",FILES)
+$ IF F.EQS."," THEN GOTO END
+$ eflags_name="cflags_''f'"
+$ name_len=f$length(eflags_name)
+$ dash_pos=f$locate("-",eflags_name)
+$ if dash_pos.ne.name_len
+$ then
+$ eflags_name['dash_pos,1]:="_"
+$ dash_pos=f$locate("-",eflags_name)
+$ if dash_pos.ne.name_len then eflags_name['dash_pos,1]:="_"
+$ endif
+$ if f$type('eflags_name).eqs."" then eflags_name="cflags_nil"
+$ eflags='eflags_name
+$ write sys$output "Compiling ", F, ".c", eflags
+$ cc 'CFLAGS 'eflags 'F.c
+$ IF OBJS.NES."" THEN OBJS=OBJS + ","
+$ OBJS=OBJS + F + ".obj"
+$ NUM = NUM + 1
+$ GOTO LOOP
+$ END:
+$ purge
+$ lib/create libbfd 'OBJS
+$EOD