uwin.h revision 132718
152284Sobrien/* Operating system specific defines to be used when targeting GCC for 252284Sobrien hosting on U/WIN (Windows32), using GNU tools and the Windows32 API 352284Sobrien Library, as distinct from winnt.h, which is used to build GCC for use 452284Sobrien with a windows style library and tool set and uses the Microsoft tools. 5132718Skan Copyright (C) 1999, 2002, 2003 Free Software Foundation, Inc. 652284Sobrien Contributed by Mumit Khan <khan@xraylith.wisc.edu>. 752284Sobrien 8132718SkanThis file is part of GCC. 952284Sobrien 10132718SkanGCC is free software; you can redistribute it and/or modify 1152284Sobrienit under the terms of the GNU General Public License as published by 1252284Sobrienthe Free Software Foundation; either version 2, or (at your option) 1352284Sobrienany later version. 1452284Sobrien 15132718SkanGCC is distributed in the hope that it will be useful, 1652284Sobrienbut WITHOUT ANY WARRANTY; without even the implied warranty of 1752284SobrienMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 1852284SobrienGNU General Public License for more details. 1952284Sobrien 2052284SobrienYou should have received a copy of the GNU General Public License 21132718Skanalong with GCC; see the file COPYING. If not, write to 2252284Sobrienthe Free Software Foundation, 59 Temple Place - Suite 330, 2390075SobrienBoston, MA 02111-1307, USA. */ 2452284Sobrien 2552284Sobrien/* Most of this is the same as for Cygwin32, except for changing some 2652284Sobrien specs. */ 2752284Sobrien 2852284Sobrien#define STANDARD_INCLUDE_COMPONENT "UWIN" 2952284Sobrien#define SYSTEM_INCLUDE_DIR "/usr/gnu/include" 3090075Sobrien#undef MD_STARTFILE_PREFIX 3190075Sobrien#define MD_STARTFILE_PREFIX "/usr/gnu/lib/" 3252284Sobrien 33117395Skan#undef MAYBE_UWIN_CPP_BUILTINS 34117395Skan#define MAYBE_UWIN_CPP_BUILTINS() \ 35117395Skan do \ 36117395Skan { \ 37117395Skan builtin_define_std ("WINNT"); \ 38117395Skan builtin_define ("_WIN32"); \ 39117395Skan builtin_define ("__WIN32__"); \ 40117395Skan builtin_define ("_UWIN"); \ 41117395Skan builtin_define ("__UWIN__"); \ 42117395Skan builtin_define ("__MSVCRT__"); \ 43117395Skan builtin_define ("_STD_INCLUDE_DIR=mingw32"); \ 44117395Skan } \ 45117395Skan while (0) 4652284Sobrien 4752284Sobrien#undef CPP_SPEC 48117395Skan#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \ 4952284Sobrien -include /usr/include/astwin32.h \ 5052284Sobrien -idirafter /usr/gnu/include/mingw32" 5152284Sobrien 5252284Sobrien/* For Windows applications, include more libraries, but always include 5352284Sobrien kernel32. */ 5452284Sobrien#undef LIB_SPEC 5552284Sobrien#define LIB_SPEC \ 5690075Sobrien "%{pg:-lgmon} %{mwindows:-luser32 -lgdi32 -lcomdlg32} -lkernel32 -ladvapi32" 5752284Sobrien 5890075Sobrien/* This is needed in g77spec.c for now. Will be removed in the future. */ 5952284Sobrien#define WIN32_UWIN_TARGET 1 6052284Sobrien 6152284Sobrien/* Include in the mingw32 libraries with libgcc */ 6252284Sobrien#undef LIBGCC_SPEC 6352284Sobrien#define LIBGCC_SPEC "-lgnuwin -lposix -lgcc -last -lmoldname -lmsvcrt" 6452284Sobrien 6552284Sobrien/* Specify a different entry point when linking a DLL */ 6652284Sobrien#undef LINK_SPEC 6752284Sobrien#define LINK_SPEC \ 6890075Sobrien "%{mwindows:--subsystem windows} %{mdll:--dll -e _DllMainCRTStartup@12} \ 6990075Sobrien %{!mdll:-u _main}" 7052284Sobrien 7152284Sobrien#undef STARTFILE_SPEC 7290075Sobrien#define STARTFILE_SPEC "%{mdll:dllcrt2%O%s} %{!mdll:crt2%O%s} %{pg:gcrt2%O%s}" 7352284Sobrien 7490075Sobrien/* These are PE BFD bug workarounds. Should go away eventually. */ 7552284Sobrien 7690075Sobrien/* Write the extra assembler code needed to declare a function 7790075Sobrien properly. If we are generating SDB debugging information, this 7890075Sobrien will happen automatically, so we only need to handle other cases. */ 7952284Sobrien#undef ASM_DECLARE_FUNCTION_NAME 8052284Sobrien#define ASM_DECLARE_FUNCTION_NAME(FILE, NAME, DECL) \ 8152284Sobrien do \ 8252284Sobrien { \ 8352284Sobrien if (i386_pe_dllexport_name_p (NAME)) \ 8490075Sobrien i386_pe_record_exported_symbol (NAME, 0); \ 8590075Sobrien /* UWIN binutils bug workaround. */ \ 8652284Sobrien if (0 && write_symbols != SDB_DEBUG) \ 8752284Sobrien i386_pe_declare_function_type (FILE, NAME, TREE_PUBLIC (DECL)); \ 8852284Sobrien ASM_OUTPUT_LABEL (FILE, NAME); \ 8952284Sobrien } \ 9052284Sobrien while (0) 9152284Sobrien 9252284Sobrien#undef ASM_OUTPUT_EXTERNAL 9352284Sobrien#undef ASM_OUTPUT_EXTERNAL_LIBCALL 9452284Sobrien 95