Commit f60ed6be by Neil Booth Committed by Neil Booth

crtdll.h: Define EXTRA_OS_CPP_BUILTINS.

	* config/i386/crtdll.h: Define EXTRA_OS_CPP_BUILTINS.
	Don't use CPP_PREDEFINES.
	* config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): New.
	Used TARGET_OS_CPP_BUILTINS in preference to CPP_PREDEFINES.
	* config/i386/djgpp.h, config/i386/i386-coff.h,
	config/i386/i386-interix.h, config/i386/i386-interix3.h,
	config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
	config/i386/openbsd.h, config/i386/ptx4-i.h, config/i386/sysv3.h,
	config/i386/uwin.h: Similarly.

From-SVN: r55101
parent ddd9819e
2002-06-29 Neil Booth <neil@daikokuya.demon.co.uk>
* config/i386/crtdll.h: Define EXTRA_OS_CPP_BUILTINS.
Don't use CPP_PREDEFINES.
* config/i386/cygwin.h (EXTRA_OS_CPP_BUILTINS): New.
Used TARGET_OS_CPP_BUILTINS in preference to CPP_PREDEFINES.
* config/i386/djgpp.h, config/i386/i386-coff.h,
config/i386/i386-interix.h, config/i386/i386-interix3.h,
config/i386/lynx-ng.h, config/i386/lynx.h, config/i386/mingw32.h,
config/i386/openbsd.h, config/i386/ptx4-i.h, config/i386/sysv3.h,
config/i386/uwin.h: Similarly.
2002-06-29 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl> 2002-06-29 Herman A.J. ten Brugge <Haj.Ten.Brugge@net.HCC.nl>
* c4x.h: (TARGET_CPU_CPP_BUILTINS): Check flag_inline_functions and * c4x.h: (TARGET_CPU_CPP_BUILTINS): Check flag_inline_functions and
......
...@@ -20,10 +20,9 @@ along with GNU CC; see the file COPYING. If not, write to ...@@ -20,10 +20,9 @@ along with GNU CC; see the file COPYING. If not, write to
the Free Software Foundation, 59 Temple Place - Suite 330, the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#undef CPP_PREDEFINES #undef EXTRA_OS_CPP_BUILTINS
#define CPP_PREDEFINES "-D_WIN32 -DWIN32 \ #define EXTRA_OS_CPP_BUILTINS() \
-D__MINGW32__=0.2 -DWINNT -D_X86_=1 \ do { builtin_define ("__MINGW32__=0.2"); } while (0)
-Asystem=winnt"
#undef LIBGCC_SPEC #undef LIBGCC_SPEC
#define LIBGCC_SPEC \ #define LIBGCC_SPEC \
......
...@@ -54,8 +54,23 @@ Boston, MA 02111-1307, USA. */ ...@@ -54,8 +54,23 @@ Boston, MA 02111-1307, USA. */
{ "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \ { "no-nop-fun-dllimport", -MASK_NOP_FUN_DLLIMPORT, "" }, \
{ "threads", 0, N_("Use Mingw-specific thread support") }, { "threads", 0, N_("Use Mingw-specific thread support") },
#undef CPP_PREDEFINES #define MAYBE_UWIN_CPP_BUILTINS() /* Nothing. */
#define CPP_PREDEFINES "-D_X86_=1 -Asystem=winnt" #define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("_X86_=1"); \
builtin_assert ("system=winnt"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__declspec(x)=__attribute__((x))"); \
if (!flag_iso) \
{ \
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
} \
MAYBE_UWIN_CPP_BUILTINS (); \
} \
while (0)
#ifdef CROSS_COMPILE #ifdef CROSS_COMPILE
#define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}" #define CYGWIN_INCLUDES "%{!nostdinc:-idirafter " CYGWIN_CROSS_DIR "/include}"
...@@ -97,12 +112,6 @@ Boston, MA 02111-1307, USA. */ ...@@ -97,12 +112,6 @@ Boston, MA 02111-1307, USA. */
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} \
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
%{!ansi:-D_stdcall=__attribute__((__stdcall__)) \
-D_cdecl=__attribute__((__cdecl__))} \
-D__declspec(x)=__attribute__((x)) \
-D__i386__ -D__i386 \
%{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \ %{mno-win32:%{mno-cygwin: %emno-cygwin and mno-win32 are not compatible}} \
%{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\ %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{mthreads:-D_MT} "\
MINGW_INCLUDES "} \ MINGW_INCLUDES "} \
......
...@@ -82,13 +82,18 @@ Boston, MA 02111-1307, USA. */ ...@@ -82,13 +82,18 @@ Boston, MA 02111-1307, USA. */
(((NAME)[0] == '/') || ((NAME)[0] == '\\') || \ (((NAME)[0] == '/') || ((NAME)[0] == '\\') || \
(((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':'))) (((NAME)[0] >= 'A') && ((NAME)[0] <= 'z') && ((NAME)[1] == ':')))
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-D__MSDOS__ -D__GO32__ -Asystem=msdos" do \
{ \
builtin_define_std ("MSDOS"); \
builtin_define_std ("GO32"); \
builtin_assert ("system=msdos"); \
} \
while (0)
/* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */ /* Include <sys/version.h> so __DJGPP__ and __DJGPP_MINOR__ are defined. */
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \ #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
%{!ansi:%{!std=c*:%{!std=i*:-DMSDOS}}} %{!ansi:%{!std=c*:%{!std=i*:-DGO32}}} \
-imacros %s../include/sys/version.h" -imacros %s../include/sys/version.h"
/* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl. /* We need to override link_command_spec in gcc.c so support -Tdjgpp.djl.
......
...@@ -21,12 +21,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -21,12 +21,9 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (80386, COFF BSD syntax)"); #define TARGET_VERSION fprintf (stderr, " (80386, COFF BSD syntax)");
/* Specify predefined symbols in preprocessor. */ #define TARGET_OS_CPP_BUILTINS() /* Sweet FA. */
#undef CPP_PREDEFINES
#define CPP_PREDEFINES ""
/* We want to be able to get DBX debugging information via -gstabs. */ /* We want to be able to get DBX debugging information via -gstabs. */
......
...@@ -53,30 +53,37 @@ Boston, MA 02111-1307, USA. */ ...@@ -53,30 +53,37 @@ Boston, MA 02111-1307, USA. */
#define ASM_LOAD_ADDR(loc, reg) " leal " #loc "," #reg "\n" #define ASM_LOAD_ADDR(loc, reg) " leal " #loc "," #reg "\n"
/* cpp handles __STDC__ */ /* cpp handles __STDC__ */
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES " \ do \
-D__INTERIX \ { \
-D__OPENNT \ builtin_define ("__INTERIX"); \
-D_M_IX86=300 -D_X86_=1 \ builtin_define ("__OPENNT"); \
-D__stdcall=__attribute__((__stdcall__)) \ builtin_define ("_M_IX86=300"); \
-D__cdecl=__attribute__((__cdecl__)) \ builtin_define ("_X86_=1"); \
-D__declspec(x)=__attribute__((x)) \ builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
-Asystem=unix -Asystem=interix" builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__declspec(x)=__attribute__((x))"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=interix"); \
if (preprocessing_asm_p ()) \
builtin_define_std ("LANGUAGE_ASSEMBLY"); \
else \
{ \
builtin_define_std ("LANGUAGE_C"); \
if (c_language == clk_cplusplus) \
builtin_define_std ("LANGUAGE_C_PLUS_PLUS"); \
else if (c_language == clk_objective_c) \
builtin_define_std ("LANGUAGE_OBJECTIVE_C"); \
} \
} \
while (0)
#undef CPP_SPEC #undef CPP_SPEC
/* Write out the correct language type definition for the header files. /* Write out the correct language type definition for the header files.
Unless we have assembler language, write out the symbols for C. Unless we have assembler language, write out the symbols for C.
mieee is an Alpha specific variant. Cross polination a bad idea. mieee is an Alpha specific variant. Cross polination a bad idea.
*/ */
#define CPP_SPEC "\ #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
-remap \
%{posix:-D_POSIX_SOURCE} \
-isystem %$INTERIX_ROOT/usr/include" -isystem %$INTERIX_ROOT/usr/include"
#define TARGET_VERSION fprintf (stderr, " (i386 Interix)"); #define TARGET_VERSION fprintf (stderr, " (i386 Interix)");
......
...@@ -20,12 +20,5 @@ the Free Software Foundation, 59 Temple Place - Suite 330, ...@@ -20,12 +20,5 @@ the Free Software Foundation, 59 Temple Place - Suite 330,
Boston, MA 02111-1307, USA. */ Boston, MA 02111-1307, USA. */
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "\ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
%{!.S: -D__LANGUAGE_C__ -D__LANGUAGE_C %{!ansi:-DLANGUAGE_C}} \
%{.S: -D__LANGUAGE_ASSEMBLY__ -D__LANGUAGE_ASSEMBLY %{!ansi:-DLANGUAGE_ASSEMBLY}} \
%{.cc: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.cxx: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.C: -D__LANGUAGE_C_PLUS_PLUS__ -D__LANGUAGE_C_PLUS_PLUS -D__cplusplus} \
%{.m: -D__LANGUAGE_OBJECTIVE_C__ -D__LANGUAGE_OBJECTIVE_C} \
%{posix:-D_POSIX_SOURCE}"
...@@ -20,9 +20,17 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,9 +20,17 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)"); #define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)");
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-Dunix -DI386 -DLynx -DIBITS32 \ do \
-Asystem=unix -Asystem=lynx" { \
builtin_define_std ("unix"); \
builtin_define_std ("I386"); \
builtin_define_std ("Lynx"); \
builtin_define_std ("IBITS32"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=lynx"); \
} \
while (0)
/* Provide required defaults for linker switches. */ /* Provide required defaults for linker switches. */
......
...@@ -20,8 +20,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -20,8 +20,16 @@ Boston, MA 02111-1307, USA. */
#define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)"); #define TARGET_VERSION fprintf (stderr, " (80386, LYNX BSD syntax)");
#undef CPP_PREDEFINES #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-DI386 -DLynx -DIBITS32 -Asystem=unix -Asystem=lynx" do \
{ \
builtin_define_std ("I386"); \
builtin_define_std ("Lynx"); \
builtin_define_std ("IBITS32"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=lynx"); \
} \
while (0)
/* The prefix to add to user-visible assembler symbols. */ /* The prefix to add to user-visible assembler symbols. */
......
...@@ -32,13 +32,35 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,13 +32,35 @@ Boston, MA 02111-1307, USA. */
#define TARGET_EXECUTABLE_SUFFIX ".exe" #define TARGET_EXECUTABLE_SUFFIX ".exe"
/* Please keep changes to CPP_PREDEFINES in sync with i386/crtdll. The /* See i386/crtdll.h for an altervative definition. */
only difference between the two should be __MSVCRT__ needed to #define EXTRA_OS_CPP_BUILTINS() \
distinguish MSVC from CRTDLL runtime in mingw headers. */ do \
#undef CPP_PREDEFINES { \
#define CPP_PREDEFINES "-D_WIN32 -D__WIN32 -D__WIN32__ -DWIN32 \ builtin_define ("__MSVCRT__"); \
-D__MINGW32__ -D__MSVCRT__ -DWINNT -D_X86_=1 \ builtin_define ("__MINGW32__"); \
-Asystem=winnt" } \
while (0)
#undef TARGET_OS_CPP_BUILTINS /* From cygwin.h. */
#define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define ("_WIN32"); \
builtin_define_std ("WIN32"); \
builtin_define_std ("WINNT"); \
builtin_define ("_X86_=1"); \
builtin_define ("__stdcall=__attribute__((__stdcall__))"); \
builtin_define ("__cdecl=__attribute__((__cdecl__))"); \
builtin_define ("__declspec(x)=__attribute__((x))"); \
if (!flag_iso) \
{ \
builtin_define ("_stdcall=__attribute__((__stdcall__))"); \
builtin_define ("_cdecl=__attribute__((__cdecl__))"); \
} \
EXTRA_OS_CPP_BUILTINS (); \
builtin_assert ("system=winnt"); \
} \
while (0)
/* Specific a different directory for the standard include files. */ /* Specific a different directory for the standard include files. */
#undef STANDARD_INCLUDE_DIR #undef STANDARD_INCLUDE_DIR
...@@ -47,14 +69,7 @@ Boston, MA 02111-1307, USA. */ ...@@ -47,14 +69,7 @@ Boston, MA 02111-1307, USA. */
#define STANDARD_INCLUDE_COMPONENT "MINGW" #define STANDARD_INCLUDE_COMPONENT "MINGW"
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC \ #define CPP_SPEC "%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT}"
"%{posix:-D_POSIX_SOURCE} %{mthreads:-D_MT} \
-D__stdcall=__attribute__((__stdcall__)) \
-D__cdecl=__attribute__((__cdecl__)) \
%{!ansi:-D_stdcall=__attribute__((__stdcall__)) \
-D_cdecl=__attribute__((__cdecl__))} \
-D__declspec(x)=__attribute__((x))"
/* For Windows applications, include more libraries, but always include /* For Windows applications, include more libraries, but always include
kernel32. */ kernel32. */
......
...@@ -26,9 +26,16 @@ Boston, MA 02111-1307, USA. */ ...@@ -26,9 +26,16 @@ Boston, MA 02111-1307, USA. */
#define TARGET_SUBTARGET_DEFAULT \ #define TARGET_SUBTARGET_DEFAULT \
(MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387) (MASK_80387 | MASK_IEEE_FP | MASK_FLOAT_RETURNS | MASK_NO_FANCY_MATH_387)
/* Run-time target specifications */ #define TARGET_OS_CPP_BUILTINS() \
#define CPP_PREDEFINES "-D__unix__ -D__OpenBSD__ \ do \
-Asystem=unix -Asystem=bsd -Asystem=OpenBSD" { \
builtin_define ("__unix__"); \
builtin_define ("__OpenBSD__"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=bsd"); \
builtin_assert ("system=OpenBSD"); \
} \
while (0)
/* Layout of source language data types. */ /* Layout of source language data types. */
......
...@@ -33,11 +33,15 @@ Boston, MA 02111-1307, USA. */ ...@@ -33,11 +33,15 @@ Boston, MA 02111-1307, USA. */
(TYPE_MODE (TYPE) == BLKmode \ (TYPE_MODE (TYPE) == BLKmode \
|| (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8)) || (VECTOR_MODE_P (TYPE_MODE (TYPE)) && int_size_in_bytes (TYPE) == 8))
/* Define which macros to predefine. _SEQUENT_ is our extension. */ #define TARGET_OS_CPP_BUILTINS() \
/* This used to define X86, but james@bigtex.cactus.org says that do \
is supposed to be defined optionally by user programs--not by default. */ { \
#define CPP_PREDEFINES \ builtin_define_std ("unix"); \
"-Dunix -D_SEQUENT_ -Asystem=unix -Asystem=ptx4" builtin_define ("_SEQUENT_"); \
builtin_assert ("system=unix"); \
builtin_assert ("system=ptx4"); \
} \
while (0)
#undef DBX_REGISTER_NUMBER #undef DBX_REGISTER_NUMBER
#define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n] #define DBX_REGISTER_NUMBER(n) svr4_dbx_register_map[n]
......
...@@ -32,7 +32,13 @@ Boston, MA 02111-1307, USA. */ ...@@ -32,7 +32,13 @@ Boston, MA 02111-1307, USA. */
/* Specify predefined symbols in preprocessor. */ /* Specify predefined symbols in preprocessor. */
#define CPP_PREDEFINES "-Dunix -Asystem=svr3" #define TARGET_OS_CPP_BUILTINS() \
do \
{ \
builtin_define_std ("unix"); \
builtin_assert ("system=svr3"); \
} \
while (0)
#define CPP_SPEC "%{posix:-D_POSIX_SOURCE}" #define CPP_SPEC "%{posix:-D_POSIX_SOURCE}"
......
...@@ -30,16 +30,19 @@ Boston, MA 02111-1307, USA. */ ...@@ -30,16 +30,19 @@ Boston, MA 02111-1307, USA. */
#undef MD_STARTFILE_PREFIX #undef MD_STARTFILE_PREFIX
#define MD_STARTFILE_PREFIX "/usr/gnu/lib/" #define MD_STARTFILE_PREFIX "/usr/gnu/lib/"
#undef CPP_PREDEFINES #undef MAYBE_UWIN_CPP_BUILTINS
#define CPP_PREDEFINES "-D_WIN32 -D__WIN32__ \ #define MAYBE_UWIN_CPP_BUILTINS() \
-D_UWIN -DWINNT -D_X86_=1 -D__STDC__=1 \ do \
-D__UWIN__ -D__MSVCRT__ \ { \
-D_STD_INCLUDE_DIR=mingw32 \ builtin_define_std ("WINNT"); \
-D__stdcall=__attribute__((__stdcall__)) \ builtin_define ("_WIN32"); \
_D_stdcall=__attribute__((__stdcall__)) \ builtin_define ("__WIN32__"); \
-D__cdecl=__attribute__((__cdecl__)) \ builtin_define ("_UWIN"); \
-D__declspec(x)=__attribute__((x)) \ builtin_define ("__UWIN__"); \
-Asystem=winnt" builtin_define ("__MSVCRT__"); \
builtin_define ("_STD_INCLUDE_DIR=mingw32"); \
} \
while (0)
#undef CPP_SPEC #undef CPP_SPEC
#define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \ #define CPP_SPEC "-remap %{posix:-D_POSIX_SOURCE} \
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment