]>
Commit | Line | Data |
---|---|---|
14c7c974 A |
1 | /* |
2 | * Copyright (c) 1999 Apple Computer, Inc. All rights reserved. | |
3 | * | |
4 | * @APPLE_LICENSE_HEADER_START@ | |
5 | * | |
f083c6c3 A |
6 | * Copyright (c) 1999-2003 Apple Computer, Inc. All Rights Reserved. |
7 | * | |
8 | * This file contains Original Code and/or Modifications of Original Code | |
9 | * as defined in and that are subject to the Apple Public Source License | |
10 | * Version 2.0 (the 'License'). You may not use this file except in | |
11 | * compliance with the License. Please obtain a copy of the License at | |
12 | * http://www.opensource.apple.com/apsl/ and read it before using this | |
13 | * file. | |
14c7c974 A |
14 | * |
15 | * The Original Code and all software distributed under the License are | |
f083c6c3 | 16 | * distributed on an 'AS IS' basis, WITHOUT WARRANTY OF ANY KIND, EITHER |
14c7c974 A |
17 | * EXPRESS OR IMPLIED, AND APPLE HEREBY DISCLAIMS ALL SUCH WARRANTIES, |
18 | * INCLUDING WITHOUT LIMITATION, ANY WARRANTIES OF MERCHANTABILITY, | |
f083c6c3 A |
19 | * FITNESS FOR A PARTICULAR PURPOSE, QUIET ENJOYMENT OR NON-INFRINGEMENT. |
20 | * Please see the License for the specific language governing rights and | |
21 | * limitations under the License. | |
14c7c974 A |
22 | * |
23 | * @APPLE_LICENSE_HEADER_END@ | |
24 | */ | |
25 | /* outform.h header file for binding output format drivers to the | |
26 | * remainder of the code in the Netwide Assembler | |
27 | * | |
28 | * The Netwide Assembler is copyright (C) 1996 Simon Tatham and | |
29 | * Julian Hall. All rights reserved. The software is | |
30 | * redistributable under the licence given in the file "Licence" | |
31 | * distributed in the NASM archive. | |
32 | */ | |
33 | ||
34 | /* | |
35 | * This header file allows configuration of which output formats | |
36 | * get compiled into the NASM binary. You can configure by defining | |
37 | * various preprocessor symbols beginning with "OF_", either on the | |
38 | * compiler command line or at the top of this file. | |
39 | * | |
40 | * OF_ONLY -- only include specified object formats | |
41 | * OF_name -- ensure that output format 'name' is included | |
42 | * OF_NO_name -- remove output format 'name' | |
43 | * OF_DOS -- ensure that 'obj', 'bin' & 'win32' are included. | |
44 | * OF_UNIX -- ensure that 'aout', 'aoutb', 'coff', 'elf' are in. | |
45 | * OF_OTHERS -- ensure that 'bin', 'as86' & 'rdf' are in. | |
46 | * OF_ALL -- ensure that all formats are included. | |
47 | * | |
48 | * OF_DEFAULT=of_name -- ensure that 'name' is the default format. | |
49 | * | |
50 | * eg: -DOF_UNIX -DOF_ELF -DOF_DEFAULT=of_elf would be a suitable config | |
51 | * for an average linux system. | |
52 | * | |
53 | * Default config = -DOF_ALL -DOF_DEFAULT=of_bin | |
54 | * | |
55 | * You probably only want to set these options while compiling 'nasm.c'. */ | |
56 | ||
57 | #ifndef NASM_OUTFORM_H | |
58 | #define NASM_OUTFORM_H | |
59 | ||
60 | #include "nasm.h" | |
61 | ||
62 | #define MAX_OUTPUT_FORMATS 16 | |
63 | ||
64 | struct ofmt *ofmt_find(char *); | |
65 | void ofmt_list(struct ofmt *, FILE *); | |
66 | void ofmt_register (struct ofmt *); | |
67 | ||
68 | /* -------------- USER MODIFIABLE PART ---------------- */ | |
69 | ||
70 | /* | |
71 | * Insert #defines here in accordance with the configuration | |
72 | * instructions above. | |
73 | * | |
74 | * E.g. | |
75 | * | |
76 | * #define OF_ONLY | |
77 | * #define OF_OBJ | |
78 | * #define OF_BIN | |
79 | * | |
80 | * for a 16-bit DOS assembler with no extraneous formats. | |
81 | */ | |
82 | ||
83 | /* ------------ END USER MODIFIABLE PART -------------- */ | |
84 | ||
85 | /* ====configurable info begins here==== */ | |
86 | /* formats configurable: | |
87 | * bin,obj,elf,aout,aoutb,coff,win32,as86,rdf */ | |
88 | ||
89 | /* process options... */ | |
90 | ||
91 | #ifndef OF_ONLY | |
92 | #ifndef OF_ALL | |
93 | #define OF_ALL /* default is to have all formats */ | |
94 | #endif | |
95 | #endif | |
96 | ||
97 | #ifdef OF_ALL /* set all formats on... */ | |
98 | #ifndef OF_BIN | |
99 | #define OF_BIN | |
100 | #endif | |
101 | #ifndef OF_OBJ | |
102 | #define OF_OBJ | |
103 | #endif | |
104 | #ifndef OF_ELF | |
105 | #define OF_ELF | |
106 | #endif | |
107 | #ifndef OF_COFF | |
108 | #define OF_COFF | |
109 | #endif | |
110 | #ifndef OF_AOUT | |
111 | #define OF_AOUT | |
112 | #endif | |
113 | #ifndef OF_AOUTB | |
114 | #define OF_AOUTB | |
115 | #endif | |
116 | #ifndef OF_WIN32 | |
117 | #define OF_WIN32 | |
118 | #endif | |
119 | #ifndef OF_AS86 | |
120 | #define OF_AS86 | |
121 | #endif | |
122 | #ifndef OF_RDF | |
123 | #define OF_RDF | |
124 | #endif | |
125 | #endif /* OF_ALL */ | |
126 | ||
127 | /* turn on groups of formats specified.... */ | |
128 | #ifdef OF_DOS | |
129 | #ifndef OF_OBJ | |
130 | #define OF_OBJ | |
131 | #endif | |
132 | #ifndef OF_BIN | |
133 | #define OF_BIN | |
134 | #endif | |
135 | #ifndef OF_WIN32 | |
136 | #define OF_WIN32 | |
137 | #endif | |
138 | #endif | |
139 | ||
140 | #ifdef OF_UNIX | |
141 | #ifndef OF_AOUT | |
142 | #define OF_AOUT | |
143 | #endif | |
144 | #ifndef OF_AOUTB | |
145 | #define OF_AOUTB | |
146 | #endif | |
147 | #ifndef OF_COFF | |
148 | #define OF_COFF | |
149 | #endif | |
150 | #ifndef OF_ELF | |
151 | #define OF_ELF | |
152 | #endif | |
153 | #endif | |
154 | ||
155 | #ifdef OF_OTHERS | |
156 | #ifndef OF_BIN | |
157 | #define OF_BIN | |
158 | #endif | |
159 | #ifndef OF_AS86 | |
160 | #define OF_AS86 | |
161 | #endif | |
162 | #ifndef OF_RDF | |
163 | #define OF_RDF | |
164 | #endif | |
165 | #endif | |
166 | ||
167 | /* finally... override any format specifically specifed to be off */ | |
168 | #ifdef OF_NO_BIN | |
169 | #undef OF_BIN | |
170 | #endif | |
171 | #ifdef OF_NO_OBJ | |
172 | #undef OF_OBJ | |
173 | #endif | |
174 | #ifdef OF_NO_ELF | |
175 | #undef OF_ELF | |
176 | #endif | |
177 | #ifdef OF_NO_AOUT | |
178 | #undef OF_AOUT | |
179 | #endif | |
180 | #ifdef OF_NO_AOUTB | |
181 | #undef OF_AOUTB | |
182 | #endif | |
183 | #ifdef OF_NO_COFF | |
184 | #undef OF_COFF | |
185 | #endif | |
186 | #ifdef OF_NO_WIN32 | |
187 | #undef OF_WIN32 | |
188 | #endif | |
189 | #ifdef OF_NO_AS86 | |
190 | #undef OF_AS86 | |
191 | #endif | |
192 | #ifdef OF_NO_RDF | |
193 | #undef OF_RDF | |
194 | #endif | |
195 | ||
196 | #ifndef OF_DEFAULT | |
197 | #define OF_DEFAULT of_bin | |
198 | #endif | |
199 | ||
200 | #endif /* NASM_OUTFORM_H */ |