| 1 | |
| 2 | The GAS Configuration Plan |
| 3 | |
| 4 | Theory: |
| 5 | |
| 6 | The goal of the new configuration scheme is to bury all object format, |
| 7 | target processor, and host machine dependancies in object, target, and |
| 8 | host specific files. That is, to move all #ifdef's out of the gas |
| 9 | common code. |
| 10 | |
| 11 | Here's how it works. There is a .h and a .c file for each object file |
| 12 | format, a .h and a .c file for each target processor, and a .h for |
| 13 | each host. config.gas creates {sym}links in the current directory to |
| 14 | the appropriate files in the config directory. config.gas also serves |
| 15 | as a list of triplets {host, target, object-format} that have been |
| 16 | tested at one time or another. I also recommend that config.gas be |
| 17 | used to document triplet specific notes as to purpose of the triplet, |
| 18 | etc. |
| 19 | |
| 20 | Implementation: |
| 21 | |
| 22 | host.h is a {sym}link to .../config/xm-yourhost.h. It is intended to |
| 23 | be used to hide host compiler, system header file, and system library |
| 24 | differences between host machines. If your host needs actual c source |
| 25 | files, then either: these are generally useful functions, in which |
| 26 | case you should probably build a local library outside of the gas |
| 27 | source tree, or someone, perhaps me, is confused about what is needed |
| 28 | by different hosts. |
| 29 | |
| 30 | obj-format.h is a {sym}link to .../config/obj-something.h. It is intended |
| 31 | |
| 32 | All gas .c files include as.h. |
| 33 | |
| 34 | as.h #define's "gas", includes host.h, defines a number of gas |
| 35 | specific structures and types, and then includes tp.h, obj.h, and |
| 36 | target-environment.h. |
| 37 | |
| 38 | target-environment.h defines a target environment specific |
| 39 | preprocessor flag, eg, TE_SUN, and then includes obj-format.h. |
| 40 | |
| 41 | obj-format.h defines an object format specific preprocessor flag, eg, |
| 42 | OBJ_AOUT, OBJ_BOUT, OBJ_COFF, includes "target-processor.h", and then |
| 43 | defines the object specific macros, functions, types, and structures. |
| 44 | |
| 45 | target-processor.h |
| 46 | |
| 47 | target-processor. |
| 48 | |
| 49 | Porting: |
| 50 | |
| 51 | There appear to be four major types of ports; new hosts, new target |
| 52 | processors, new object file formats, and new target environments. |