Only create gcc/configargs.h if gcc build directory is present
[official-gcc.git] / gcc / defaults.h
blobd5e8884511503b1db6df78fa7c9975ee58a0b669
1 /* Definitions of various defaults for how to do assembler output
2 (most of which are designed to be appropriate for GAS or for
3 some BSD assembler).
4 Copyright (C) 1992, 1996, 1997, 1998, 1999, 2000
5 Free Software Foundation, Inc.
6 Contributed by Ron Guilmette (rfg@monkeys.com)
8 This file is part of GNU CC.
10 GNU CC is free software; you can redistribute it and/or modify
11 it under the terms of the GNU General Public License as published by
12 the Free Software Foundation; either version 2, or (at your option)
13 any later version.
15 GNU CC is distributed in the hope that it will be useful,
16 but WITHOUT ANY WARRANTY; without even the implied warranty of
17 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
18 GNU General Public License for more details.
20 You should have received a copy of the GNU General Public License
21 along with GNU CC; see the file COPYING. If not, write to
22 the Free Software Foundation, 59 Temple Place - Suite 330,
23 Boston, MA 02111-1307, USA. */
25 #ifndef GCC_DEFAULTS_H
26 #define GCC_DEFAULTS_H
28 /* Store in OUTPUT a string (made with alloca) containing
29 an assembler-name for a local static variable or function named NAME.
30 LABELNO is an integer which is different for each call. */
32 #ifndef ASM_FORMAT_PRIVATE_NAME
33 #define ASM_FORMAT_PRIVATE_NAME(OUTPUT, NAME, LABELNO) \
34 do { \
35 int len = strlen (NAME); \
36 char *temp = (char *) alloca (len + 3); \
37 temp[0] = 'L'; \
38 strcpy (&temp[1], (NAME)); \
39 temp[len + 1] = '.'; \
40 temp[len + 2] = 0; \
41 (OUTPUT) = (char *) alloca (strlen (NAME) + 11); \
42 ASM_GENERATE_INTERNAL_LABEL (OUTPUT, temp, LABELNO); \
43 } while (0)
44 #endif
46 #ifndef ASM_STABD_OP
47 #define ASM_STABD_OP "\t.stabd\t"
48 #endif
50 /* This is how to output an element of a case-vector that is absolute.
51 Some targets don't use this, but we have to define it anyway. */
53 #ifndef ASM_OUTPUT_ADDR_VEC_ELT
54 #define ASM_OUTPUT_ADDR_VEC_ELT(FILE, VALUE) \
55 do { fprintf (FILE, "\t%s\t", ASM_LONG); \
56 ASM_OUTPUT_INTERNAL_LABEL (FILE, "L", (VALUE)); \
57 fputc ('\n', FILE); \
58 } while (0)
59 #endif
61 /* Provide default for ASM_OUTPUT_ALTERNATE_LABEL_NAME. */
62 #ifndef ASM_OUTPUT_ALTERNATE_LABEL_NAME
63 #define ASM_OUTPUT_ALTERNATE_LABEL_NAME(FILE,INSN) \
64 do { ASM_OUTPUT_LABEL(FILE,LABEL_ALTERNATE_NAME (INSN)); } while (0)
65 #endif
67 /* choose a reasonable default for ASM_OUTPUT_ASCII. */
69 #ifndef ASM_OUTPUT_ASCII
70 #define ASM_OUTPUT_ASCII(MYFILE, MYSTRING, MYLENGTH) \
71 do { \
72 FILE *_hide_asm_out_file = (MYFILE); \
73 const unsigned char *_hide_p = (const unsigned char *) (MYSTRING); \
74 int _hide_thissize = (MYLENGTH); \
75 { \
76 FILE *asm_out_file = _hide_asm_out_file; \
77 const unsigned char *p = _hide_p; \
78 int thissize = _hide_thissize; \
79 int i; \
80 fprintf (asm_out_file, "\t.ascii \""); \
82 for (i = 0; i < thissize; i++) \
83 { \
84 register int c = p[i]; \
85 if (c == '\"' || c == '\\') \
86 putc ('\\', asm_out_file); \
87 if (ISPRINT(c)) \
88 putc (c, asm_out_file); \
89 else \
90 { \
91 fprintf (asm_out_file, "\\%o", c); \
92 /* After an octal-escape, if a digit follows, \
93 terminate one string constant and start another. \
94 The Vax assembler fails to stop reading the escape \
95 after three digits, so this is the only way we \
96 can get it to parse the data properly. */ \
97 if (i < thissize - 1 && ISDIGIT(p[i + 1])) \
98 fprintf (asm_out_file, "\"\n\t.ascii \""); \
99 } \
101 fprintf (asm_out_file, "\"\n"); \
104 while (0)
105 #endif
107 #ifndef ASM_IDENTIFY_GCC
108 /* Default the definition, only if ASM_IDENTIFY_GCC is not set,
109 because if it is set, we might not want ASM_IDENTIFY_LANGUAGE
110 outputting labels, if we do want it to, then it must be defined
111 in the tm.h file. */
112 #ifndef ASM_IDENTIFY_LANGUAGE
113 #define ASM_IDENTIFY_LANGUAGE(FILE) output_lang_identify (FILE);
114 #endif
115 #endif
117 /* This is how we tell the assembler to equate two values. */
118 #ifdef SET_ASM_OP
119 #ifndef ASM_OUTPUT_DEF
120 #define ASM_OUTPUT_DEF(FILE,LABEL1,LABEL2) \
121 do { fprintf ((FILE), "%s", SET_ASM_OP); \
122 assemble_name (FILE, LABEL1); \
123 fprintf (FILE, ","); \
124 assemble_name (FILE, LABEL2); \
125 fprintf (FILE, "\n"); \
126 } while (0)
127 #endif
128 #endif
130 /* This is how to output a reference to a user-level label named NAME. */
132 #ifndef ASM_OUTPUT_LABELREF
133 #define ASM_OUTPUT_LABELREF(FILE,NAME) asm_fprintf ((FILE), "%U%s", (NAME))
134 #endif
136 /* This determines whether or not we support weak symbols. */
137 #ifndef SUPPORTS_WEAK
138 #ifdef ASM_WEAKEN_LABEL
139 #define SUPPORTS_WEAK 1
140 #else
141 #define SUPPORTS_WEAK 0
142 #endif
143 #endif
145 /* If the target supports weak symbols, define TARGET_ATTRIBUTE_WEAK to
146 provide a weak attribute. Else define it to nothing.
148 This would normally belong in gansidecl.h, but SUPPORTS_WEAK is
149 not available at that time.
151 Note, this is only for use by target files which we know are to be
152 compiled by GCC. */
153 #ifndef TARGET_ATTRIBUTE_WEAK
154 # if SUPPORTS_WEAK
155 # define TARGET_ATTRIBUTE_WEAK __attribute__ ((weak))
156 # else
157 # define TARGET_ATTRIBUTE_WEAK
158 # endif
159 #endif
161 /* If we have a definition of INCOMING_RETURN_ADDR_RTX, assume that
162 the rest of the DWARF 2 frame unwind support is also provided. */
163 #if !defined (DWARF2_UNWIND_INFO) && defined (INCOMING_RETURN_ADDR_RTX)
164 #define DWARF2_UNWIND_INFO 1
165 #endif
167 #if defined (DWARF2_UNWIND_INFO) && !defined (EH_FRAME_SECTION)
168 # if defined (EH_FRAME_SECTION_ASM_OP)
169 # define EH_FRAME_SECTION() eh_frame_section();
170 # else
171 /* If we aren't using crtstuff to run ctors, don't use it for EH. */
172 # if defined (ASM_OUTPUT_SECTION_NAME) && defined (ASM_OUTPUT_CONSTRUCTOR)
173 # define EH_FRAME_SECTION_ASM_OP "\t.section\t.eh_frame,\"aw\""
174 # define EH_FRAME_SECTION() \
175 do { named_section (NULL_TREE, ".eh_frame", 0); } while (0)
176 # endif
177 # endif
178 #endif
180 /* By default, we generate a label at the beginning and end of the
181 text section, and compute the size of the text section by
182 subtracting the two. However, on some platforms that doesn't
183 work, and we use the section itself, rather than a label at the
184 beginning of it, to indicate the start of the section. On such
185 platforms, define this to zero. */
186 #ifndef DWARF2_GENERATE_TEXT_SECTION_LABEL
187 #define DWARF2_GENERATE_TEXT_SECTION_LABEL 1
188 #endif
190 /* Supply a default definition for PROMOTE_PROTOTYPES. */
191 #ifndef PROMOTE_PROTOTYPES
192 #define PROMOTE_PROTOTYPES 0
193 #endif
195 /* Number of hardware registers that go into the DWARF-2 unwind info.
196 If not defined, equals FIRST_PSEUDO_REGISTER */
198 #ifndef DWARF_FRAME_REGISTERS
199 #define DWARF_FRAME_REGISTERS FIRST_PSEUDO_REGISTER
200 #endif
202 /* Default sizes for base C types. If the sizes are different for
203 your target, you should override these values by defining the
204 appropriate symbols in your tm.h file. */
206 #ifndef CHAR_TYPE_SIZE
207 #define CHAR_TYPE_SIZE BITS_PER_UNIT
208 #endif
210 #ifndef SHORT_TYPE_SIZE
211 #define SHORT_TYPE_SIZE (BITS_PER_UNIT * MIN ((UNITS_PER_WORD + 1) / 2, 2))
212 #endif
214 #ifndef INT_TYPE_SIZE
215 #define INT_TYPE_SIZE BITS_PER_WORD
216 #endif
218 #ifndef LONG_TYPE_SIZE
219 #define LONG_TYPE_SIZE BITS_PER_WORD
220 #endif
222 #ifndef LONG_LONG_TYPE_SIZE
223 #define LONG_LONG_TYPE_SIZE (BITS_PER_WORD * 2)
224 #endif
226 #ifndef WCHAR_TYPE_SIZE
227 #define WCHAR_TYPE_SIZE INT_TYPE_SIZE
228 #endif
230 #ifndef WCHAR_UNSIGNED
231 #define WCHAR_UNSIGNED 0
232 #endif
234 #ifndef FLOAT_TYPE_SIZE
235 #define FLOAT_TYPE_SIZE BITS_PER_WORD
236 #endif
238 #ifndef DOUBLE_TYPE_SIZE
239 #define DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
240 #endif
242 #ifndef LONG_DOUBLE_TYPE_SIZE
243 #define LONG_DOUBLE_TYPE_SIZE (BITS_PER_WORD * 2)
244 #endif
246 #endif /* GCC_DEFAULTS_H */