| 1 | $! |
| 2 | $! This file configures the bfd library for use with openVMS/Alpha |
| 3 | $! We do not use the configure script, since we do not have /bin/sh |
| 4 | $! to execute it. |
| 5 | $! |
| 6 | $! Written by Klaus K"ampf (kkaempf@progis.de) |
| 7 | $! |
| 8 | $arch_indx = 1 + ((f$getsyi("CPU").ge.128).and.1) ! vax==1, alpha==2 |
| 9 | $arch = f$element(arch_indx,"|","|VAX|Alpha|") |
| 10 | $if arch .eqs. "VAX" |
| 11 | $then |
| 12 | $ write sys$output "Target VAX not supported." |
| 13 | $ exit 2 |
| 14 | $endif |
| 15 | $! |
| 16 | $! copy bfd-in2.h to bfd.h, replacing @ macros |
| 17 | $! |
| 18 | $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - |
| 19 | []bfd-in2.h /output=[]bfd.h |
| 20 | $DECK |
| 21 | ! |
| 22 | ! Copy file, changing lines with macros (@@) |
| 23 | ! |
| 24 | ! |
| 25 | vfile := CREATE_BUFFER("vfile", "VERSION."); |
| 26 | POSITION(BEGINNING_OF(vfile)); |
| 27 | vers := CURRENT_LINE; |
| 28 | |
| 29 | file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); |
| 30 | rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); |
| 31 | |
| 32 | match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang); |
| 33 | IF match_pos <> 0 THEN; |
| 34 | POSITION(BEGINNING_OF(match_pos)); |
| 35 | ERASE(match_pos); |
| 36 | COPY_TEXT(vers); |
| 37 | ENDIF; |
| 38 | match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang); |
| 39 | IF match_pos <> 0 THEN; |
| 40 | POSITION(BEGINNING_OF(match_pos)); |
| 41 | ERASE(match_pos); |
| 42 | COPY_TEXT('64'); |
| 43 | ENDIF; |
| 44 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang); |
| 45 | IF match_pos <> 0 THEN; |
| 46 | POSITION(BEGINNING_OF(match_pos)); |
| 47 | ERASE(match_pos); |
| 48 | COPY_TEXT('0'); |
| 49 | ENDIF; |
| 50 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang); |
| 51 | IF match_pos <> 0 THEN; |
| 52 | POSITION(BEGINNING_OF(match_pos)); |
| 53 | ERASE(match_pos); |
| 54 | COPY_TEXT('__DECC'); |
| 55 | SPLIT_LINE; |
| 56 | COPY_TEXT('#include <ints.h>'); |
| 57 | ENDIF; |
| 58 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang); |
| 59 | IF match_pos <> 0 THEN; |
| 60 | POSITION(BEGINNING_OF(match_pos)); |
| 61 | ERASE(match_pos); |
| 62 | COPY_TEXT('int64'); |
| 63 | ENDIF; |
| 64 | match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang); |
| 65 | IF match_pos <> 0 THEN; |
| 66 | POSITION(BEGINNING_OF(match_pos)); |
| 67 | ERASE(match_pos); |
| 68 | COPY_TEXT('uint64'); |
| 69 | ENDIF; |
| 70 | WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); |
| 71 | QUIT |
| 72 | $ EOD |
| 73 | $ write sys$output "Generated `bfd.h' from `bfd-in2.h'." |
| 74 | $! |
| 75 | $! |
| 76 | $! create targmatch.h |
| 77 | $! |
| 78 | $ open/write tfile []targmatch.h |
| 79 | $ write tfile "{ " + """alpha-*-*vms*""" + "," |
| 80 | $ write tfile "#if defined (SELECT_VECS)" |
| 81 | $ write tfile "SELECT_VECS" |
| 82 | $ write tfile "#else" |
| 83 | $ write tfile "UNSUPPORTED_TARGET" |
| 84 | $ write tfile "#endif" |
| 85 | $ write tfile "}," |
| 86 | $ close tfile |
| 87 | $ write sys$output "Generated `targmatch.h'" |
| 88 | $! |
| 89 | $! |
| 90 | $! create config.h |
| 91 | $! |
| 92 | $ create []config.h |