OSDN Git Service

34a15facbf71328bc672164a0987e2ce0cbdb8aa
[pf3gnuchains/gcc-fork.git] / gcc / config / i386 / djgpp.h
1 /* Configuration for an i386 running MS-DOS with DJGPP.
2    Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2004, 2005, 2007,
3    2010 Free Software Foundation, Inc.
4
5 This file is part of GCC.
6
7 GCC is free software; you can redistribute it and/or modify
8 it under the terms of the GNU General Public License as published by
9 the Free Software Foundation; either version 3, or (at your option)
10 any later version.
11
12 GCC is distributed in the hope that it will be useful,
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15 GNU General Public License for more details.
16
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING3.  If not see
19 <http://www.gnu.org/licenses/>.  */
20
21 /* Support generation of DWARF2 debugging info.  */
22 #define DWARF2_DEBUGGING_INFO 1
23
24 /* Don't assume anything about the header files.  */
25 #define NO_IMPLICIT_EXTERN_C
26
27 /* If defined, a C expression whose value is a string containing the
28    assembler operation to identify the following data as
29    uninitialized global data.  If not defined, and neither
30    `ASM_OUTPUT_BSS' nor `ASM_OUTPUT_ALIGNED_BSS' are defined,
31    uninitialized global data will be output in the data section if
32    `-fno-common' is passed, otherwise `ASM_OUTPUT_COMMON' will be
33    used.  */
34 #undef BSS_SECTION_ASM_OP
35 #define BSS_SECTION_ASM_OP "\t.section\t.bss"
36
37 /* Define the name of the .data section.  */
38 #undef DATA_SECTION_ASM_OP
39 #define DATA_SECTION_ASM_OP "\t.section .data"
40
41 /* Define the name of the .ident op.  */
42 #undef IDENT_ASM_OP
43 #define IDENT_ASM_OP "\t.ident\t"
44
45 /* Enable alias attribute support.  */
46 #ifndef SET_ASM_OP
47 #define SET_ASM_OP "\t.set\t"
48 #endif
49
50 /* Define the name of the .text section.  */
51 #undef TEXT_SECTION_ASM_OP
52 #define TEXT_SECTION_ASM_OP "\t.section .text"
53
54 /* Define standard DJGPP installation paths.  */
55 /* We override default /usr or /usr/local part with /dev/env/DJDIR which */
56 /* points to actual DJGPP installation directory.  */
57
58 /* Standard include directory */
59 #undef STANDARD_INCLUDE_DIR
60 #define STANDARD_INCLUDE_DIR "/dev/env/DJDIR/include/"
61
62 /* Search for as.exe and ld.exe in DJGPP's binary directory.  */ 
63 #undef MD_EXEC_PREFIX
64 #define MD_EXEC_PREFIX "/dev/env/DJDIR/bin/"
65
66 /* Standard DJGPP library and startup files */
67 #undef MD_STARTFILE_PREFIX
68 #define MD_STARTFILE_PREFIX "/dev/env/DJDIR/lib/"
69
70 /* Correctly handle absolute filename detection in cp/xref.c */
71 #define FILE_NAME_ABSOLUTE_P(NAME) \
72         (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
73         (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
74
75 #define TARGET_OS_CPP_BUILTINS()                \
76   do                                            \
77     {                                           \
78         builtin_define_std ("MSDOS");           \
79         builtin_define_std ("GO32");            \
80         builtin_assert ("system=msdos");        \
81     }                                           \
82   while (0)
83
84 /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined.  */
85 #undef CPP_SPEC
86 #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
87   -imacros %s../include/sys/version.h"
88
89 /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
90    This cannot be done in LINK_SPECS as that LINK_SPECS is processed
91    before library search directories are known by the linker.
92    This avoids problems when specs file is not available. An alternate way,
93    suggested by Robert Hoehne, is to use SUBTARGET_EXTRA_SPECS instead.
94 */ 
95
96 #undef LINK_COMMAND_SPEC
97 #define LINK_COMMAND_SPEC \
98 "%{!fsyntax-only: \
99 %{!c:%{!M:%{!MM:%{!E:%{!S:%(linker) %l %X %{o*} %{e*} %{N} %{n} \
100 \t%{r} %{s} %{t} %{u*} %{z} %{Z}\
101 \t%{!nostdlib:%{!nostartfiles:%S}}\
102 \t%{static:} %{L*} %D %o\
103 \t%{!nostdlib:%{!nodefaultlibs:%G %L %G}}\
104 \t%{!nostdlib:%{!nostartfiles:%E}}\
105 \t-Tdjgpp.djl %{T*}}}}}}}\n\
106 %{!c:%{!M:%{!MM:%{!E:%{!S:stubify %{v} %{o*:%*} %{!o*:a.out} }}}}}"
107
108 /* Always just link in 'libc.a'.  */
109 #undef LIB_SPEC
110 #define LIB_SPEC "-lc"
111
112 /* Pick the right startup code depending on the -pg flag.  */
113 #undef STARTFILE_SPEC
114 #define STARTFILE_SPEC "%{pg:gcrt0.o%s}%{!pg:crt0.o%s}"
115
116 /* Make sure that gcc will not look for .h files in /usr/local/include 
117    unless user explicitly requests it.  */
118 #undef LOCAL_INCLUDE_DIR
119
120 /* Switch into a generic section.  */
121 #define TARGET_ASM_NAMED_SECTION  default_coff_asm_named_section
122
123 /* This is how to output an assembler line
124    that says to advance the location counter
125    to a multiple of 2**LOG bytes.  */
126
127 #undef ASM_OUTPUT_ALIGN
128 #define ASM_OUTPUT_ALIGN(FILE,LOG) \
129   if ((LOG) != 0) fprintf ((FILE), "\t.p2align %d\n", LOG)
130
131 /* This is how to output a global symbol in the BSS section.  */
132 #undef ASM_OUTPUT_ALIGNED_BSS
133 #define ASM_OUTPUT_ALIGNED_BSS(FILE, DECL, NAME, SIZE, ALIGN) \
134   asm_output_aligned_bss ((FILE), (DECL), (NAME), (SIZE), (ALIGN))
135
136 /* This is how to tell assembler that a symbol is weak  */ 
137 #undef ASM_WEAKEN_LABEL
138 #define ASM_WEAKEN_LABEL(FILE,NAME) \
139   do { fputs ("\t.weak\t", FILE); assemble_name (FILE, NAME); \
140        fputc ('\n', FILE); } while (0)
141
142 /* djgpp automatically calls its own version of __main, so don't define one
143    in libgcc, nor call one in main().  */
144 #define HAS_INIT_SECTION
145
146 /* Definitions for types and sizes. Wide characters are 16-bits long so
147    Win32 compiler add-ons will be wide character compatible.  */
148 #undef WCHAR_TYPE_SIZE
149 #define WCHAR_TYPE_SIZE 16
150
151 #undef WCHAR_TYPE
152 #define WCHAR_TYPE "short unsigned int"
153
154 #undef WINT_TYPE
155 #define WINT_TYPE "int"
156
157 #undef SIZE_TYPE
158 #define SIZE_TYPE "long unsigned int"
159
160 #undef PTRDIFF_TYPE
161 #define PTRDIFF_TYPE "int"
162
163 /* Used to be defined in xm-djgpp.h, but moved here for cross-compilers.  */
164 #define LIBSTDCXX "stdcxx"
165
166 #define TARGET_VERSION fprintf (stderr, " (80386, MS-DOS DJGPP)"); 
167
168 /* Warn that -mbnu210 is now obsolete.  */
169 #undef  SUBTARGET_OVERRIDE_OPTIONS
170 #define SUBTARGET_OVERRIDE_OPTIONS \
171 do \
172   { \
173     if (TARGET_BNU210) \
174       { \
175         warning (0, "-mbnu210 is ignored (option is obsolete)"); \
176       } \
177   } \
178 while (0)
179
180 /* Support for C++ templates.  */
181 #undef MAKE_DECL_ONE_ONLY
182 #define MAKE_DECL_ONE_ONLY(DECL) (DECL_WEAK (DECL) = 1)