48b8276ae5bf700fdb76b78a1da3f17ebc5428d0
[platform/upstream/nasm.git] / outform.h
1 /* outform.h    header file for binding output format drivers to the
2  *              remainder of the code in the Netwide Assembler
3  *
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  */
9
10 /*
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.
15  *
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', 'coff' and 'elf' are in.
21  * OF_OTHERS              -- ensure that 'bin', 'as86' & 'rdf' are in.
22  * OF_ALL                 -- ensure that all formats are included.
23  *
24  * OF_DEFAULT=of_name     -- ensure that 'name' is the default format.
25  *
26  * eg: -DOF_UNIX -DOF_ELF -DOF_DEFAULT=of_elf would be a suitable config
27  * for an average linux system.
28  *
29  * Default config = -DOF_ALL -DOF_DEFAULT=of_bin
30  *
31  * You probably only want to set these options while compiling 'nasm.c'. */
32
33 #ifndef NASM_OUTFORM_H
34 #define NASM_OUTFORM_H
35
36 #include "nasm.h"
37
38 #define MAX_OUTPUT_FORMATS 16
39
40 struct ofmt *ofmt_find(char *name);
41 void ofmt_list(struct ofmt *deffmt);
42 void ofmt_register (struct ofmt *);
43
44 /* -------------- USER MODIFIABLE PART ---------------- */
45
46 /*
47  * Insert #defines here in accordance with the configuration
48  * instructions above.
49  *
50  * E.g.
51  *
52  * #define OF_ONLY
53  * #define OF_OBJ
54  * #define OF_BIN
55  *
56  * for a 16-bit DOS assembler with no extraneous formats.
57  */
58
59 /* ------------ END USER MODIFIABLE PART -------------- */
60
61 /* ====configurable info begins here==== */
62 /* formats configurable:
63  * bin,obj,elf,aout,coff,win32,as86,rdf */
64
65 /* process options... */
66
67 #ifndef OF_ONLY
68 #ifndef OF_ALL
69 #define OF_ALL      /* default is to have all formats */
70 #endif
71 #endif
72
73 #ifdef OF_ALL      /* set all formats on... */
74 #ifndef OF_BIN
75 #define OF_BIN
76 #endif
77 #ifndef OF_OBJ
78 #define OF_OBJ
79 #endif
80 #ifndef OF_ELF
81 #define OF_ELF
82 #endif
83 #ifndef OF_COFF
84 #define OF_COFF
85 #endif
86 #ifndef OF_AOUT
87 #define OF_AOUT
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 #endif /* OF_ALL */
99
100 /* turn on groups of formats specified.... */
101 #ifdef OF_DOS
102 #ifndef OF_OBJ
103 #define OF_OBJ
104 #endif
105 #ifndef OF_BIN
106 #define OF_BIN
107 #endif
108 #ifndef OF_WIN32
109 #define OF_WIN32
110 #endif
111 #endif
112
113 #ifdef OF_UNIX
114 #ifndef OF_AOUT
115 #define OF_AOUT
116 #endif
117 #ifndef OF_COFF
118 #define OF_COFF
119 #endif
120 #ifndef OF_ELF
121 #define OF_ELF
122 #endif
123 #endif
124
125 #ifdef OF_OTHERS
126 #ifndef OF_BIN
127 #define OF_BIN
128 #endif
129 #ifndef OF_AS86
130 #define OF_AS86
131 #endif
132 #ifndef OF_RDF
133 #define OF_RDF
134 #endif
135 #endif
136
137 /* finally... override any format specifically specifed to be off */
138 #ifdef OF_NO_BIN
139 #undef OF_BIN
140 #endif
141 #ifdef OF_NO_OBJ
142 #undef OF_OBJ
143 #endif
144 #ifdef OF_NO_ELF
145 #undef OF_ELF
146 #endif
147 #ifdef OF_NO_AOUT
148 #undef OF_AOUT
149 #endif
150 #ifdef OF_NO_COFF
151 #undef OF_COFF
152 #endif
153 #ifdef OF_NO_WIN32
154 #undef OF_WIN32
155 #endif
156 #ifdef OF_NO_AS86
157 #undef OF_AS86
158 #endif
159 #ifdef OF_NO_RDF
160 #undef OF_RDF
161 #endif
162
163 #ifndef OF_DEFAULT
164 #define OF_DEFAULT of_bin
165 #endif
166
167 #endif  /* NASM_OUTFORM_H */