]>
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. |
45936a85 | 3 | Copyright (C) 1997, 1998, 1999, 2000, 2001 Free Software Foundation, Inc. |
6407d0da RK |
4 | |
5 | This file is part of GNU CC. | |
6 | ||
7 | GNU CC 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 2, or (at your option) | |
10 | any later version. | |
11 | ||
12 | GNU CC 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 GNU CC; see the file COPYING. If not, write to | |
19 | the Free Software Foundation, 59 Temple Place - Suite 330, | |
892a2d68 | 20 | Boston, MA 02111-1307, USA. */ |
6407d0da | 21 | |
cae21ae8 | 22 | /* Most of this is the same as for cygwin, except for changing some |
6407d0da RK |
23 | specs. */ |
24 | ||
0a977123 | 25 | /* Mingw GCC, unlike Cygwin's, must be relocatable. This macro must |
892a2d68 | 26 | be defined before any other files are included. */ |
0a977123 CF |
27 | #ifndef WIN32_NO_ABSOLUTE_INST_DIRS |
28 | #define WIN32_NO_ABSOLUTE_INST_DIRS 1 | |
29 | #endif | |
30 | ||
cae21ae8 | 31 | #include "i386/cygwin.h" |
6407d0da | 32 | |
45936a85 DD |
33 | #define TARGET_EXECUTABLE_SUFFIX ".exe" |
34 | ||
3fafc2f6 MK |
35 | /* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The |
36 | only difference between the two should be __MSVCRT__ needed to | |
892a2d68 | 37 | distinguish MSVC from CRTDLL runtime in mingw headers. */ |
6407d0da | 38 | #undef CPP_PREDEFINES |
0a977123 CF |
39 | #define CPP_PREDEFINES "-D_WIN32 -D__WIN32 -D__WIN32__ -DWIN32 \ |
40 | -D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 \ | |
2b57e919 | 41 | -Asystem=winnt" |
6407d0da | 42 | |
23092526 MK |
43 | /* Specific a different directory for the standard include files. */ |
44 | #undef STANDARD_INCLUDE_DIR | |
0a977123 CF |
45 | #define STANDARD_INCLUDE_DIR "/usr/local/mingw32/include" |
46 | #undef STANDARD_INCLUDE_COMPONENT | |
47 | #define STANDARD_INCLUDE_COMPONENT "MINGW" | |
23092526 | 48 | |
2b9f972f | 49 | #undef CPP_SPEC |
f22a97d2 | 50 | #define CPP_SPEC \ |
2afc3e47 MK |
51 | "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \ |
52 | -D__stdcall=__attribute__((__stdcall__)) \ | |
53 | -D__cdecl=__attribute__((__cdecl__)) \ | |
54 | %{!ansi:-D_stdcall=__attribute__((__stdcall__)) \ | |
55 | -D_cdecl=__attribute__((__cdecl__))} \ | |
56 | -D__declspec(x)=__attribute__((x))" | |
57 | ||
2b9f972f | 58 | |
6407d0da RK |
59 | /* For Windows applications, include more libraries, but always include |
60 | kernel32. */ | |
61 | #undef LIB_SPEC | |
9b0b6c51 | 62 | #define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \ |
c6df90d8 | 63 | -luser32 -lkernel32 -ladvapi32 -lshell32" |
6407d0da | 64 | |
9c7c6e6c TP |
65 | /* Include in the mingw32 libraries with libgcc */ |
66 | #undef LINK_SPEC | |
67 | #define LINK_SPEC "%{mwindows:--subsystem windows} \ | |
68 | %{mconsole:--subsystem console} \ | |
69 | %{shared: %{mdll: %eshared and mdll are not compatible}} \ | |
70 | %{shared: --shared} %{mdll:--dll} \ | |
71 | %{static:-Bstatic} %{!static:-Bdynamic} \ | |
72 | %{shared|mdll: -e _DllMainCRTStartup@12}" | |
73 | ||
23092526 | 74 | /* Include in the mingw32 libraries with libgcc */ |
6407d0da | 75 | #undef LIBGCC_SPEC |
f22a97d2 MK |
76 | #define LIBGCC_SPEC \ |
77 | "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmsvcrt" | |
6407d0da | 78 | |
23092526 | 79 | #undef STARTFILE_SPEC |
9c7c6e6c TP |
80 | #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \ |
81 | %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}" | |
23092526 | 82 | |
892a2d68 | 83 | /* MS runtime does not need a separate math library. */ |
0a977123 | 84 | #undef MATH_LIBRARY |
c6df90d8 | 85 | #define MATH_LIBRARY "" |
23092526 | 86 | |
0a977123 CF |
87 | /* Output STRING, a string representing a filename, to FILE. |
88 | We canonicalize it to be in MS-DOS format. */ | |
89 | #undef OUTPUT_QUOTED_STRING | |
23092526 MK |
90 | #define OUTPUT_QUOTED_STRING(FILE, STRING) \ |
91 | do { \ | |
92 | char c; \ | |
93 | \ | |
94 | putc ('\"', asm_file); \ | |
23092526 MK |
95 | \ |
96 | while ((c = *string++) != 0) \ | |
97 | { \ | |
98 | if (c == '\\') \ | |
99 | c = '/'; \ | |
100 | \ | |
101 | if (c == '\"') \ | |
102 | putc ('\\', asm_file); \ | |
103 | putc (c, asm_file); \ | |
104 | } \ | |
105 | \ | |
106 | putc ('\"', asm_file); \ | |
107 | } while (0) | |
108 | ||
9b0b6c51 MK |
109 | /* Override Cygwin's definition. This is necessary now due to the way |
110 | Cygwin profiling code is written. Once "fixed", we can remove this. */ | |
111 | #undef SUBTARGET_PROLOGUE | |
112 |