1145b13b3cb6e284959852989815e1992b96f8ec
1 /* Operating system specific defines to be used when targeting GCC for
2 hosting on Windows32, using GNU tools and the Windows32 API Library.
3 Copyright (C) 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004
4 Free Software Foundation, Inc.
6 This file is part of GCC.
8 GCC is free software; you can redistribute it and/or modify
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)
13 GCC is distributed in the hope that it will be useful,
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.
18 You should have received a copy of the GNU General Public License
19 along with GCC; see the file COPYING. If not, write to
20 the Free Software Foundation, 51 Franklin Street, Fifth Floor,
21 Boston, MA 02110-1301, USA. */
24 #if TARGET_64BIT_DEFAULT
25 #define TARGET_VERSION fprintf (stderr,"(x86_64 MinGW");
27 #define TARGET_VERSION fprintf (stderr," (x86 MinGW)");
30 /* See i386/crtdll.h for an alternative definition. _INTEGRAL_MAX_BITS
31 is for compatibility with native compiler. */
32 #define EXTRA_OS_CPP_BUILTINS() \
35 builtin_define ("__MSVCRT__"); \
36 builtin_define ("__MINGW32__"); \
37 builtin_define ("_WIN32"); \
38 builtin_define_std ("WIN32"); \
39 builtin_define_std ("WINNT"); \
40 builtin_define_with_int_value ("_INTEGRAL_MAX_BITS", \
41 TYPE_PRECISION (intmax_type_node));\
42 if (TARGET_64BIT_MS_ABI) \
44 builtin_define ("__MINGW64__"); \
45 builtin_define_std ("WIN64"); \
46 builtin_define_std ("_WIN64"); \
51 /* Override the standard choice of /usr/include as the default prefix
52 to try when searching for header files. */
53 #undef STANDARD_INCLUDE_DIR
54 #if TARGET_64BIT_DEFAULT
55 #define STANDARD_INCLUDE_DIR "/mingw/include64"
57 #define STANDARD_INCLUDE_DIR "/mingw/include"
59 #undef STANDARD_INCLUDE_COMPONENT
60 #define STANDARD_INCLUDE_COMPONENT "MINGW"
63 #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}"
65 /* For Windows applications, include more libraries, but always include
68 #define LIB_SPEC "%{pg:-lgmon} %{mwindows:-lgdi32 -lcomdlg32} \
69 -luser32 -lkernel32 -ladvapi32 -lshell32"
71 /* Include in the mingw32 libraries with libgcc */
73 #define LINK_SPEC "%{mwindows:--subsystem windows} \
74 %{mconsole:--subsystem console} \
75 %{shared: %{mdll: %eshared and mdll are not compatible}} \
76 %{shared: --shared} %{mdll:--dll} \
77 %{static:-Bstatic} %{!static:-Bdynamic} \
78 %{shared|mdll: -e _DllMainCRTStartup@12}"
80 /* Include in the mingw32 libraries with libgcc */
83 "%{mthreads:-lmingwthrd} -lmingw32 -lgcc -lmoldname -lmingwex -lmsvcrt"
86 #define STARTFILE_SPEC "%{shared|mdll:dllcrt2%O%s} \
87 %{!shared:%{!mdll:crt2%O%s}} %{pg:gcrt2%O%s}"
90 #define ENDFILE_SPEC \
91 "%{ffast-math|funsafe-math-optimizations:crtfastmath.o%s}"
93 /* Override startfile prefix defaults. */
94 #ifndef STANDARD_STARTFILE_PREFIX_1
95 #if TARGET_64BIT_DEFAULT
96 #define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib64/"
98 #define STANDARD_STARTFILE_PREFIX_1 "/mingw/lib/"
101 #ifndef STANDARD_STARTFILE_PREFIX_2
102 #define STANDARD_STARTFILE_PREFIX_2 ""
105 /* Output STRING, a string representing a filename, to FILE.
106 We canonicalize it to be in Unix format (backslashes are replaced
108 #undef OUTPUT_QUOTED_STRING
109 #define OUTPUT_QUOTED_STRING(FILE, STRING) \
113 putc ('\"', asm_file); \
115 while ((c = *string++) != 0) \
123 putc ('\\', asm_file); \
124 putc (c, asm_file); \
127 fprintf (asm_file, "\\%03o", (unsigned char) c); \
130 putc ('\"', asm_file); \
133 /* Define as short unsigned for compatibility with MS runtime. */
135 #define WINT_TYPE "short unsigned int"
137 /* mingw32 uses the -mthreads option to enable thread support. */
138 #undef GOMP_SELF_SPECS
139 #define GOMP_SELF_SPECS "%{fopenmp: -mthreads}"
141 /* mingw32 atexit function is safe to use in shared libraries. Use it
142 to register C++ static destructors. */
143 #define TARGET_CXX_USE_ATEXIT_FOR_CXA_ATEXIT hook_bool_void_true