]>
Commit | Line | Data |
---|---|---|
6407d0da | 1 | /* Operating system specific defines to be used when targeting GCC for |
db009825 | 2 | hosting on Windows32, using GNU tools and the Windows32 API Library. |
caec2cfc | 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004 |
e898926c | 4 | Free Software Foundation, Inc. |
6407d0da | 5 | |
188fc5b5 | 6 | This file is part of GCC. |
6407d0da | 7 | |
188fc5b5 | 8 | GCC is free software; you can redistribute it and/or modify |
6407d0da RK |
9 | it under the terms of the GNU General Public License as published by |
10 | the Free Software Foundation; either version 2, or (at your option) | |
11 | any later version. | |
12 | ||
188fc5b5 | 13 | GCC is distributed in the hope that it will be useful, |
6407d0da RK |
14 | but WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
16 | GNU General Public License for more details. | |
17 | ||
18 | You should have received a copy of the GNU General Public License | |
188fc5b5 | 19 | along with GCC; see the file COPYING. If not, write to |
39d14dda KC |
20 | the Free Software Foundation, 51 Franklin Street, Fifth Floor, |
21 | Boston, MA 02110-1301, USA. */ | |
6407d0da | 22 | |
70e5e841 CF |
23 | #undef TARGET_VERSION |
24 | #define TARGET_VERSION fprintf (stderr, " (x86 MinGW)"); | |
45936a85 | 25 | |
d1f87653 | 26 | /* See i386/crtdll.h for an alternative definition. */ |
f60ed6be NB |
27 | #define EXTRA_OS_CPP_BUILTINS() \ |
28 | do \ | |
29 | { \ | |
30 | builtin_define ("__MSVCRT__"); \ | |
31 | builtin_define ("__MINGW32__"); \ | |
70e5e841 CF |
32 | builtin_define ("_WIN32"); \ |
33 | builtin_define_std ("WIN32"); \ | |
34 | builtin_define_std ("WINNT"); \ | |
f60ed6be NB |
35 | } \ |
36 | while (0) | |
37 | ||
0bcbfabb AL |
38 | /* Override the standard choice of /usr/include as the default prefix |
39 | to try when searching for header files. */ | |
23092526 | 40 | #undef STANDARD_INCLUDE_DIR |
0bcbfabb | 41 | #define STANDARD_INCLUDE_DIR "/mingw/include" |
0a977123 CF |
42 | #undef STANDARD_INCLUDE_COMPONENT |
43 | #define STANDARD_INCLUDE_COMPONENT "MINGW" | |
23092526 | 44 | |
2b9f972f | 45 | #undef CPP_SPEC |
f60ed6be | 46 | #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}" |
2b9f972f | 47 | |
6407d0da RK |
48 | /* For Windows applications, include more libraries, but always include |
49 | kernel32. */ | |
50 | #undef LIB_SPEC | |
9b0b6c51 | 51 | #define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \ |
c6df90d8 | 52 | -luser32 -lkernel32 -ladvapi32 -lshell32" |
6407d0da | 53 | |
9c7c6e6c TP |
54 | /* Include in the mingw32 libraries with libgcc */ |
55 | #undef LINK_SPEC | |
56 | #define LINK_SPEC "%{mwindows:--subsystem windows} \ | |
57 | %{mconsole:--subsystem console} \ | |
58 | %{shared: %{mdll: %eshared and mdll are not compatible}} \ | |
59 | %{shared: --shared} %{mdll:--dll} \ | |
60 | %{static:-Bstatic} %{!static:-Bdynamic} \ | |
61 | %{shared|mdll: -e _DllMainCRTStartup@12}" | |
62 | ||
23092526 | 63 | /* Include in the mingw32 libraries with libgcc */ |
6407d0da | 64 | #undef LIBGCC_SPEC |
f22a97d2 | 65 | #define LIBGCC_SPEC \ |
e898926c | 66 | "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt" |
6407d0da | 67 | |
23092526 | 68 | #undef STARTFILE_SPEC |
9c7c6e6c TP |
69 | #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ |
70 | %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}" | |
23092526 | 71 | |
656c7a3a AL |
72 | /* Override startfile prefix defaults. */ |
73 | #ifndef STANDARD_STARTFILE_PREFIX_1 | |
74 | #define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/" | |
75 | #endif | |
76 | #ifndef STANDARD_STARTFILE_PREFIX_2 | |
77 | #define STANDARD_STARTFILE_PREFIX_2 "" | |
78 | #endif | |
0bcbfabb | 79 | |
0a977123 | 80 | /* Output STRING, a string representing a filename, to FILE. |
d1f87653 | 81 | We canonicalize it to be in Unix format (backslashes are replaced |
211a0cbe | 82 | forward slashes. */ |
0a977123 | 83 | #undef OUTPUT_QUOTED_STRING |
211a0cbe GDR |
84 | #define OUTPUT_QUOTED_STRING(FILE, STRING) \ |
85 | do { \ | |
86 | char c; \ | |
87 | \ | |
88 | putc ('\"', asm_file); \ | |
89 | \ | |
90 | while ((c = *string++) != 0) \ | |
91 | { \ | |
92 | if (c == '\\') \ | |
93 | c = '/'; \ | |
94 | \ | |
95 | if (ISPRINT (c)) \ | |
96 | { \ | |
97 | if (c == '\"') \ | |
98 | putc ('\\', asm_file); \ | |
99 | putc (c, asm_file); \ | |
100 | } \ | |
101 | else \ | |
102 | fprintf (asm_file, "\\%03o", (unsigned char) c); \ | |
103 | } \ | |
104 | \ | |
105 | putc ('\"', asm_file); \ | |
23092526 MK |
106 | } while (0) |
107 | ||
d1f87653 | 108 | /* Define as short unsigned for compatibility with MS runtime. */ |
355426ab DS |
109 | #undef WINT_TYPE |
110 | #define WINT_TYPE "short unsigned int" |