NASM 0.98.09
[nasm.git] / outform.h
blob18d47689b494aedd04aec742ee75121397c7c774
1 /* outform.h header file for binding output format drivers to the
2 * remainder of the code in the Netwide Assembler
4 * The Netwide Assembler is copyright (C) 1996 Simon Tatham and
5 * Julian Hall. All rights reserved. The software is
6 * redistributable under the licence given in the file "Licence"
7 * distributed in the NASM archive.
8 */
11 * This header file allows configuration of which output formats
12 * get compiled into the NASM binary. You can configure by defining
13 * various preprocessor symbols beginning with "OF_", either on the
14 * compiler command line or at the top of this file.
16 * OF_ONLY -- only include specified object formats
17 * OF_name -- ensure that output format 'name' is included
18 * OF_NO_name -- remove output format 'name'
19 * OF_DOS -- ensure that 'obj', 'bin' & 'win32' are included.
20 * OF_UNIX -- ensure that 'aout', 'aoutb', 'coff', 'elf' are in.
21 * OF_OTHERS -- ensure that 'bin', 'as86' & 'rdf' are in.
22 * OF_ALL -- ensure that all formats are included.
23 * note that this doesn't include 'dbg', which is
24 * only really useful if you're doing development
25 * work on NASM. Define OF_DBG if you want this.
27 * OF_DEFAULT=of_name -- ensure that 'name' is the default format.
29 * eg: -DOF_UNIX -DOF_ELF -DOF_DEFAULT=of_elf would be a suitable config
30 * for an average linux system.
32 * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
34 * You probably only want to set these options while compiling 'nasm.c'. */
36 #ifndef NASM_OUTFORM_H
37 #define NASM_OUTFORM_H
39 #include "nasm.h"
41 /* -------------- USER MODIFIABLE PART ---------------- */
44 * Insert #defines here in accordance with the configuration
45 * instructions above.
47 * E.g.
49 * #define OF_ONLY
50 * #define OF_OBJ
51 * #define OF_BIN
53 * for a 16-bit DOS assembler with no extraneous formats.
56 /* ------------ END USER MODIFIABLE PART -------------- */
58 /* ====configurable info begins here==== */
59 /* formats configurable:
60 * bin,obj,elf,aout,aoutb,coff,win32,as86,rdf,rdf2 */
62 /* process options... */
64 #ifndef OF_ONLY
65 #ifndef OF_ALL
66 #define OF_ALL /* default is to have all formats */
67 #endif
68 #endif
70 #ifdef OF_ALL /* set all formats on... */
71 #ifndef OF_BIN
72 #define OF_BIN
73 #endif
74 #ifndef OF_OBJ
75 #define OF_OBJ
76 #endif
77 #ifndef OF_ELF
78 #define OF_ELF
79 #endif
80 #ifndef OF_COFF
81 #define OF_COFF
82 #endif
83 #ifndef OF_AOUT
84 #define OF_AOUT
85 #endif
86 #ifndef OF_AOUTB
87 #define OF_AOUTB
88 #endif
89 #ifndef OF_WIN32
90 #define OF_WIN32
91 #endif
92 #ifndef OF_AS86
93 #define OF_AS86
94 #endif
95 #ifndef OF_RDF
96 #define OF_RDF
97 #endif
98 #ifndef OF_RDF2
99 #define OF_RDF2
100 #endif
101 #ifndef OF_IEEE
102 #define OF_IEEE
103 #endif
104 #endif /* OF_ALL */
106 /* turn on groups of formats specified.... */
107 #ifdef OF_DOS
108 #ifndef OF_OBJ
109 #define OF_OBJ
110 #endif
111 #ifndef OF_BIN
112 #define OF_BIN
113 #endif
114 #ifndef OF_WIN32
115 #define OF_WIN32
116 #endif
117 #endif
119 #ifdef OF_UNIX
120 #ifndef OF_AOUT
121 #define OF_AOUT
122 #endif
123 #ifndef OF_AOUTB
124 #define OF_AOUTB
125 #endif
126 #ifndef OF_COFF
127 #define OF_COFF
128 #endif
129 #ifndef OF_ELF
130 #define OF_ELF
131 #endif
132 #endif
134 #ifdef OF_OTHERS
135 #ifndef OF_BIN
136 #define OF_BIN
137 #endif
138 #ifndef OF_AS86
139 #define OF_AS86
140 #endif
141 #ifndef OF_RDF
142 #define OF_RDF
143 #endif
144 #ifndef OF_RDF2
145 #define OF_RDF2
146 #endif
147 #ifndef OF_IEEE
148 #define OF_IEEE
149 #endif
150 #endif
152 /* finally... override any format specifically specified to be off */
153 #ifdef OF_NO_BIN
154 #undef OF_BIN
155 #endif
156 #ifdef OF_NO_OBJ
157 #undef OF_OBJ
158 #endif
159 #ifdef OF_NO_ELF
160 #undef OF_ELF
161 #endif
162 #ifdef OF_NO_AOUT
163 #undef OF_AOUT
164 #endif
165 #ifdef OF_NO_AOUTB
166 #undef OF_AOUTB
167 #endif
168 #ifdef OF_NO_COFF
169 #undef OF_COFF
170 #endif
171 #ifdef OF_NO_WIN32
172 #undef OF_WIN32
173 #endif
174 #ifdef OF_NO_AS86
175 #undef OF_AS86
176 #endif
177 #ifdef OF_NO_RDF
178 #undef OF_RDF
179 #endif
180 #ifdef OF_NO_RDF2
181 #undef OF_RDF
182 #endif
183 #ifdef OF_NO_IEEE
184 #undef OF_IEEE
185 #endif
187 #ifndef OF_DEFAULT
188 #define OF_DEFAULT of_bin
189 #endif
191 #ifdef BUILD_DRIVERS_ARRAY /* only if included from outform.c */
193 /* pull in the externs for the different formats, then make the *drivers
194 * array based on the above defines */
196 extern struct ofmt of_bin;
197 extern struct ofmt of_aout;
198 extern struct ofmt of_aoutb;
199 extern struct ofmt of_coff;
200 extern struct ofmt of_elf;
201 extern struct ofmt of_as86;
202 extern struct ofmt of_obj;
203 extern struct ofmt of_win32;
204 extern struct ofmt of_rdf;
205 extern struct ofmt of_rdf2;
206 extern struct ofmt of_ieee;
207 extern struct ofmt of_dbg;
209 struct ofmt *drivers[]={
210 #ifdef OF_BIN
211 &of_bin,
212 #endif
213 #ifdef OF_AOUT
214 &of_aout,
215 #endif
216 #ifdef OF_AOUTB
217 &of_aoutb,
218 #endif
219 #ifdef OF_COFF
220 &of_coff,
221 #endif
222 #ifdef OF_ELF
223 &of_elf,
224 #endif
225 #ifdef OF_AS86
226 &of_as86,
227 #endif
228 #ifdef OF_OBJ
229 &of_obj,
230 #endif
231 #ifdef OF_WIN32
232 &of_win32,
233 #endif
234 #ifdef OF_RDF
235 &of_rdf,
236 #endif
237 #ifdef OF_RDF2
238 &of_rdf2,
239 #endif
240 #ifdef OF_IEEE
241 &of_ieee,
242 #endif
243 #ifdef OF_DBG
244 &of_dbg,
245 #endif
247 NULL
250 #endif /* BUILD_DRIVERS_ARRAY */
252 struct ofmt *ofmt_find(char *);
253 struct dfmt *dfmt_find(struct ofmt *, char *);
254 void ofmt_list(struct ofmt *, FILE *);
255 void dfmt_list(struct ofmt *ofmt, FILE *fp);
256 struct ofmt *ofmt_register (efunc error);
258 #endif /* NASM_OUTFORM_H */