uwin.h revision 90075
1/* Operating system specific defines to be used when targeting GCC for
2   hosting on U/WIN (Windows32), using GNU tools and the Windows32 API
3   Library, as distinct from winnt.h, which is used to build GCC for use
4   with a windows style library and tool set and uses the Microsoft tools.
5   Copyright (C) 1999 Free Software Foundation, Inc.
6   Contributed by Mumit Khan  <khan@xraylith.wisc.edu>.
7
8This file is part of GNU CC.
9
10GNU CC is free software; you can redistribute it and/or modify
11it under the terms of the GNU General Public License as published by
12the Free Software Foundation; either version 2, or (at your option)
13any later version.
14
15GNU CC is distributed in the hope that it will be useful,
16but WITHOUT ANY WARRANTY; without even the implied warranty of
17MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18GNU General Public License for more details.
19
20You should have received a copy of the GNU General Public License
21along with GNU CC; see the file COPYING.  If not, write to
22the Free Software Foundation, 59 Temple Place - Suite 330,
23Boston, MA 02111-1307, USA.  */
24
25/* Most of this is the same as for Cygwin32, except for changing some
26   specs.  */
27
28#include "i386/cygwin.h"
29
30#define STANDARD_INCLUDE_COMPONENT "UWIN"
31#define SYSTEM_INCLUDE_DIR "/usr/gnu/include"
32#undef MD_STARTFILE_PREFIX
33#define MD_STARTFILE_PREFIX "/usr/gnu/lib/"
34
35#undef CPP_PREDEFINES
36#define CPP_PREDEFINES "-D_WIN32 -D__WIN32__ \
37  -D_UWIN -DWINNT  -D_X86_=1 -D__STDC__=1 \
38  -D__UWIN__ -D__MSVCRT__ \
39  -D_STD_INCLUDE_DIR=mingw32 \
40  -D__stdcall=__attribute__((__stdcall__)) \
41  _D_stdcall=__attribute__((__stdcall__)) \
42  -D__cdecl=__attribute__((__cdecl__)) \
43  -D__declspec(x)=__attribute__((x)) \
44  -Asystem=winnt"
45
46#undef CPP_SPEC
47#define CPP_SPEC "-remap %(cpp_cpu) %{posix:-D_POSIX_SOURCE} \
48  -include /usr/include/astwin32.h \
49  -idirafter /usr/gnu/include/mingw32"
50
51/* For Windows applications, include more libraries, but always include
52   kernel32.  */
53#undef LIB_SPEC
54#define LIB_SPEC \
55  "%{pg:-lgmon} %{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32"
56
57/* This is needed in g77spec.c for now. Will be removed in the future.  */
58#define WIN32_UWIN_TARGET 1
59
60/* Include in the mingw32 libraries with libgcc */
61#undef LIBGCC_SPEC
62#define LIBGCC_SPEC "-lgnuwin -lposix -lgcc -last -lmoldname -lmsvcrt"
63
64/* Specify a different entry point when linking a DLL */
65#undef LINK_SPEC
66#define LINK_SPEC \
67  "%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12} \
68  %{!mdll:-u _main}"
69
70#undef STARTFILE_SPEC
71#define STARTFILE_SPEC "%{mdll:dllcrt2%O%s} %{!mdll:crt2%O%s} %{pg:gcrt2%O%s}"
72
73/* These are PE BFD bug workarounds. Should go away eventually.  */
74
75/* Write the extra assembler code needed to declare a function
76   properly.  If we are generating SDB debugging information, this
77   will happen automatically, so we only need to handle other cases.  */
78#undef ASM_DECLARE_FUNCTION_NAME
79#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL)			\
80  do									\
81    {									\
82      if (i386_pe_dllexport_name_p (NAME))				\
83	i386_pe_record_exported_symbol (NAME, 0);			\
84      /* UWIN binutils bug workaround.  */				\
85      if (0 && write_symbols != SDB_DEBUG)				\
86	i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL));	\
87      ASM_OUTPUT_LABEL (FILE, NAME);					\
88    }									\
89  while (0)
90
91#undef ASM_OUTPUT_EXTERNAL
92#undef ASM_OUTPUT_EXTERNAL_LIBCALL
93
94/* Override Cygwin's definition. This is necessary now due to the way
95   Cygwin profiling code is written. Once "fixed", we can remove this.  */
96#undef SUBTARGET_PROLOGUE
97
98