| 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 | $ 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" |
| 14 | $! |
| 15 | $if (arch .eqs. "alpha") .or. (arch .eqs. "ia64") |
| 16 | $then |
| 17 | $! |
| 18 | $ write sys$output "Configuring BFD for ''target' target" |
| 19 | $! |
| 20 | $! |
| 21 | $! copy bfd-in2.h to bfd.h, replacing @ macros |
| 22 | $! |
| 23 | $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - |
| 24 | []bfd-in2.h /output=[]bfd.h |
| 25 | $DECK |
| 26 | ! |
| 27 | ! Copy file, changing lines with macros (@@) |
| 28 | ! |
| 29 | ! |
| 30 | set (success,off); |
| 31 | vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN"); |
| 32 | rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile)); |
| 33 | match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); |
| 34 | IF match_pos <> 0 THEN; |
| 35 | POSITION(BEGINNING_OF(match_pos)); |
| 36 | ERASE(match_pos); |
| 37 | vers := CURRENT_LINE-")"; |
| 38 | ELSE; |
| 39 | vers := "unknown"; |
| 40 | ENDIF; |
| 41 | |
| 42 | file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); |
| 43 | rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); |
| 44 | |
| 45 | match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang); |
| 46 | IF match_pos <> 0 THEN; |
| 47 | POSITION(BEGINNING_OF(match_pos)); |
| 48 | ERASE(match_pos); |
| 49 | COPY_TEXT(vers); |
| 50 | ENDIF; |
| 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('__DECC'); |
| 86 | SPLIT_LINE; |
| 87 | COPY_TEXT('#include <ints.h>'); |
| 88 | ENDIF; |
| 89 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang); |
| 90 | IF match_pos <> 0 THEN; |
| 91 | POSITION(BEGINNING_OF(match_pos)); |
| 92 | ERASE(match_pos); |
| 93 | COPY_TEXT('int64'); |
| 94 | ENDIF; |
| 95 | match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang); |
| 96 | IF match_pos <> 0 THEN; |
| 97 | POSITION(BEGINNING_OF(match_pos)); |
| 98 | ERASE(match_pos); |
| 99 | COPY_TEXT('uint64'); |
| 100 | ENDIF; |
| 101 | match_pos := SEARCH_QUIETLY('@BFD_HOSTPTR_T@', FORWARD, EXACT, rang); |
| 102 | IF match_pos <> 0 THEN; |
| 103 | POSITION(BEGINNING_OF(match_pos)); |
| 104 | ERASE(match_pos); |
| 105 | COPY_TEXT('uint64'); |
| 106 | ENDIF; |
| 107 | match_pos := SEARCH_QUIETLY('@bfd_file_ptr@', FORWARD, EXACT, rang); |
| 108 | IF match_pos <> 0 THEN; |
| 109 | POSITION(BEGINNING_OF(match_pos)); |
| 110 | ERASE(match_pos); |
| 111 | COPY_TEXT('bfd_signed_vma'); |
| 112 | ENDIF; |
| 113 | match_pos := SEARCH_QUIETLY('unsigned @bfd_file_ptr@ ufile_ptr', FORWARD, EXACT, rang); |
| 114 | IF match_pos <> 0 THEN; |
| 115 | POSITION(BEGINNING_OF(match_pos)); |
| 116 | ERASE(match_pos); |
| 117 | COPY_TEXT('bfd_vma ufile_ptr'); |
| 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; |
| 125 | WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); |
| 126 | QUIT |
| 127 | $ EOD |
| 128 | $ |
| 129 | $else |
| 130 | $ |
| 131 | $ write sys$output "Configuring for Vax target" |
| 132 | $ target = "vax" |
| 133 | $! |
| 134 | $! copy bfd-in2.h to bfd.h, replacing @ macros |
| 135 | $! |
| 136 | $ write sys$output "Generated `bfd.h' from `bfd-in2.h'." |
| 137 | $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - |
| 138 | []bfd-in2.h /output=[]bfd.h |
| 139 | $DECK |
| 140 | ! |
| 141 | ! Copy file, changing lines with macros (@@) |
| 142 | ! |
| 143 | ! |
| 144 | set (success,off); |
| 145 | vfile := CREATE_BUFFER("vfile", "CONFIGURE.IN"); |
| 146 | rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile)); |
| 147 | match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); |
| 148 | IF match_pos <> 0 THEN; |
| 149 | POSITION(BEGINNING_OF(match_pos)); |
| 150 | ERASE(match_pos); |
| 151 | vers := CURRENT_LINE-")"; |
| 152 | ELSE; |
| 153 | vers := "unknown"; |
| 154 | ENDIF; |
| 155 | |
| 156 | file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); |
| 157 | rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); |
| 158 | |
| 159 | match_pos := SEARCH_QUIETLY('@VERSION@', FORWARD, EXACT, rang); |
| 160 | IF match_pos <> 0 THEN; |
| 161 | POSITION(BEGINNING_OF(match_pos)); |
| 162 | ERASE(match_pos); |
| 163 | COPY_TEXT(vers); |
| 164 | ENDIF; |
| 165 | match_pos := SEARCH_QUIETLY('@wordsize@', FORWARD, EXACT, rang); |
| 166 | IF match_pos <> 0 THEN; |
| 167 | POSITION(BEGINNING_OF(match_pos)); |
| 168 | ERASE(match_pos); |
| 169 | COPY_TEXT('32'); |
| 170 | ENDIF; |
| 171 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64BIT_LONG@', FORWARD, EXACT, rang); |
| 172 | IF match_pos <> 0 THEN; |
| 173 | POSITION(BEGINNING_OF(match_pos)); |
| 174 | ERASE(match_pos); |
| 175 | COPY_TEXT('0'); |
| 176 | ENDIF; |
| 177 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT_DEFINED@', FORWARD, EXACT, rang); |
| 178 | IF match_pos <> 0 THEN; |
| 179 | POSITION(BEGINNING_OF(match_pos)); |
| 180 | ERASE(match_pos); |
| 181 | COPY_TEXT('__DECC'); |
| 182 | SPLIT_LINE; |
| 183 | COPY_TEXT('#include <ints.h>'); |
| 184 | ENDIF; |
| 185 | match_pos := SEARCH_QUIETLY('@BFD_HOST_64_BIT@', FORWARD, EXACT, rang); |
| 186 | IF match_pos <> 0 THEN; |
| 187 | POSITION(BEGINNING_OF(match_pos)); |
| 188 | ERASE(match_pos); |
| 189 | COPY_TEXT('int64'); |
| 190 | ENDIF; |
| 191 | match_pos := SEARCH_QUIETLY('@BFD_HOST_U_64_BIT@', FORWARD, EXACT, rang); |
| 192 | IF match_pos <> 0 THEN; |
| 193 | POSITION(BEGINNING_OF(match_pos)); |
| 194 | ERASE(match_pos); |
| 195 | COPY_TEXT('uint64'); |
| 196 | ENDIF; |
| 197 | WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); |
| 198 | QUIT |
| 199 | $ EOD |
| 200 | $endif |
| 201 | $ |
| 202 | $! |
| 203 | $! create bfdver.h |
| 204 | $! |
| 205 | $ write sys$output "Generate `bfdver.h' from 'version.h' and `configure.in'." |
| 206 | $ edit/tpu/nojournal/nosection/nodisplay/command=sys$input - |
| 207 | []version.h /output=[]bfdver.h |
| 208 | $DECK |
| 209 | ! |
| 210 | ! Copy file, changing lines with macros (@@) |
| 211 | ! |
| 212 | ! |
| 213 | set (success,off); |
| 214 | vfile := CREATE_BUFFER("vfile", "configure.in"); |
| 215 | rang := CREATE_RANGE(BEGINNING_OF(vfile), END_OF(vfile)); |
| 216 | match_pos := SEARCH_QUIETLY('AM_INIT_AUTOMAKE(bfd, ', FORWARD, EXACT, rang); |
| 217 | IF match_pos <> 0 THEN; |
| 218 | POSITION(BEGINNING_OF(match_pos)); |
| 219 | ERASE(match_pos); |
| 220 | vers := CURRENT_LINE-")"; |
| 221 | ELSE; |
| 222 | vers := "unknown"; |
| 223 | ENDIF; |
| 224 | versnum := vers - "." - "."; |
| 225 | |
| 226 | file := CREATE_BUFFER("file", GET_INFO(COMMAND_LINE, "file_name")); |
| 227 | rang := CREATE_RANGE(BEGINNING_OF(file), END_OF(file)); |
| 228 | |
| 229 | match_pos := SEARCH_QUIETLY('@bfd_version@', FORWARD, EXACT, rang); |
| 230 | IF match_pos <> 0 THEN; |
| 231 | POSITION(BEGINNING_OF(match_pos)); |
| 232 | ERASE(match_pos); |
| 233 | COPY_TEXT(versnum); |
| 234 | ENDIF; |
| 235 | match_pos := SEARCH_QUIETLY('@bfd_version_string@', FORWARD, EXACT, rang); |
| 236 | IF match_pos <> 0 THEN; |
| 237 | POSITION(BEGINNING_OF(match_pos)); |
| 238 | ERASE(match_pos); |
| 239 | COPY_TEXT('"'); |
| 240 | COPY_TEXT(vers); |
| 241 | COPY_TEXT('"'); |
| 242 | ENDIF; |
| 243 | match_pos := SEARCH_QUIETLY('@bfd_version_package@', FORWARD, EXACT, rang); |
| 244 | IF match_pos <> 0 THEN; |
| 245 | POSITION(BEGINNING_OF(match_pos)); |
| 246 | ERASE(match_pos); |
| 247 | COPY_TEXT('"(GNU Binutils) "'); |
| 248 | ENDIF; |
| 249 | match_pos := SEARCH_QUIETLY('@report_bugs_to@', FORWARD, EXACT, rang); |
| 250 | IF match_pos <> 0 THEN; |
| 251 | POSITION(BEGINNING_OF(match_pos)); |
| 252 | ERASE(match_pos); |
| 253 | COPY_TEXT('"<http://www.sourceware.org/bugzilla/>"'); |
| 254 | ENDIF; |
| 255 | WRITE_FILE(file, GET_INFO(COMMAND_LINE, "output_file")); |
| 256 | QUIT |
| 257 | $ EOD |
| 258 | $! |
| 259 | $! |
| 260 | $! create bfd_stdint.h |
| 261 | $! |
| 262 | $ write sys$output "Generate `bfd_stdint.h'" |
| 263 | $ create []bfd_stdint.h |
| 264 | #include <inttypes.h> |
| 265 | $! |
| 266 | $! |
| 267 | $! create targmatch.h |
| 268 | $! |
| 269 | $ write sys$output "Generate `targmatch.h'" |
| 270 | $ open/write tfile []targmatch.h |
| 271 | $ write tfile "{ """ + target + "-*-*vms*""" + "," |
| 272 | $ write tfile "#if defined (SELECT_VECS)" |
| 273 | $ write tfile "SELECT_VECS" |
| 274 | $ write tfile "#else" |
| 275 | $ write tfile "UNSUPPORTED_TARGET" |
| 276 | $ write tfile "#endif" |
| 277 | $ write tfile "}," |
| 278 | $ close tfile |
| 279 | $! |
| 280 | $! |
| 281 | $! create config.h |
| 282 | $! |
| 283 | $ write sys$output "Generate `config.h'" |
| 284 | $ create []config.h |