PR preprocessor/15824
[official-gcc.git] / gcc / config / lynx.h
blob94780c6c7470735217d3cfc82851290ba51ac2b6
1 /* Target independent definitions for LynxOS.
2 Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004
3 Free Software Foundation, Inc.
5 This file is part of GCC.
7 GCC 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.
12 GCC 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.
17 You should have received a copy of the GNU General Public License
18 along with GCC; see the file COPYING. If not, write to
19 the Free Software Foundation, 59 Temple Place - Suite 330,
20 Boston, MA 02111-1307, USA. */
22 /* In this file we set up defaults that can be chosen by
23 <target>/lynx.h files. A target-specific lynx.h file can decide
24 either to define and override these definitions or to use them by
25 ensuring they are undefined at this point. If we were to #undef
26 them here we might accidentally disable some target-specific
27 defines. */
29 #ifndef EXTRA_OS_LYNX_TARGET_SPECS
30 # define EXTRA_OS_LYNX_TARGET_SPECS
31 #endif
33 #ifndef EXTRA_OS_LYNX_SPECS
34 # define EXTRA_OS_LYNX_SPECS \
35 { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
36 { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
37 { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
38 { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
39 { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
40 EXTRA_OS_LYNX_TARGET_SPECS
41 #endif
43 #ifndef SUBTARGET_EXTRA_SPECS
44 # define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
45 #endif
47 #ifndef CPP_SPEC
48 # define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
49 #endif
51 #ifndef LIB_SPEC
52 # define LIB_SPEC "%(lib_os_lynx)"
53 #endif
55 #ifndef LINK_SPEC
56 # define LINK_SPEC "%(link_os_lynx)"
57 #endif
59 #ifndef STARTFILE_SPEC
60 # define STARTFILE_SPEC "%(startfile_os_lynx)"
61 #endif
63 #ifndef ENDFILE_SPEC
64 # define ENDFILE_SPEC "%(endfile_os_lynx)"
65 #endif
67 #ifndef CPP_OS_LYNX_SPEC
68 # define CPP_OS_LYNX_SPEC \
69 "%{mthreads: \
70 %{mlegacy-threads: \
71 %eCannot use mthreads and mlegacy-threads together.}} \
72 %{mthreads: -D_MULTITHREADED} \
73 %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
74 -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
75 #endif
77 #ifndef LIB_OS_LYNX_SPEC
78 # define LIB_OS_LYNX_SPEC \
79 "%{mlegacy-threads:-lposix-pre1c} -lm -lc"
80 #endif
82 /* We link static executables for LynxOS by default unless -mshared is
83 used when linking an executable. Along the same line, we link to
84 shared libraries when linking a shared object by default unless
85 -static is used.
87 We have to pass in our -L options here otherwise the translated
88 startfile directories (%D) will take priority over this.
89 Furthermore since we have to pass in -L options here we have to
90 make sure that -L options provided by the user take priority over
91 everything we specify. */
93 #ifndef LINK_OS_LYNX_SPEC
94 # define LINK_OS_LYNX_SPEC \
95 "%{shared} %{static} \
96 %{mshared: %{static: %eCannot use mshared and static together.}} \
97 %{!mshared: %{!shared: %{!static: -static}}} \
98 %{L*} \
99 %{mthreads: \
100 %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
101 %{shared: \
102 %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
103 %{!mshared: -L/lib/thread}} \
104 %{shared: %{static: -L/lib/thread}}} \
105 %{!mthreads: \
106 %{mshared: -L/lib/shlib -rpath /lib/shlib} \
107 %{shared: -L/lib/shlib -rpath /lib/shlib}} \
108 %{mlegacy-threads:-lposix-pre1c} -lm -lc"
109 #endif
111 #ifndef STARTFILE_OS_LYNX_SPEC
112 # define STARTFILE_OS_LYNX_SPEC \
113 "%{!shared: \
114 %{!mthreads: \
115 %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
116 %{!p:%{!pg:crt1.o%s}}} \
117 %{mthreads: \
118 %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
119 %{!p:%{!pg:thread/crt1.o%s }}}}\
120 %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
121 %{!shared: crtbegin.o%s} \
122 %{shared: crtbeginS.o%s}"
123 #endif
125 #ifndef ENDFILE_OS_LYNX_SPEC
126 # define ENDFILE_OS_LYNX_SPEC \
127 "%{!shared: crtend.o%s} \
128 %{shared: crtendS.o%s} \
129 %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
130 #endif
132 /* Because of the %{m*} in cc1_options these options get substituted
133 for cc1. We ignore them here. */
135 #ifndef SUBTARGET_OS_LYNX_SWITCHES
136 # define SUBTARGET_OS_LYNX_SWITCHES \
137 { "shared", 0, N_("Use shared libraries") }, \
138 { "threads", 0, N_("Support multi-threading") }, \
139 { "legacy-threads", 0, N_("Support legacy multi-threading") },
140 #endif
142 #ifndef SUBTARGET_SWITCHES
143 # define SUBTARGET_SWITCHES SUBTARGET_OS_LYNX_SWITCHES
144 #endif
146 /* Define the actual types of some ANSI-mandated types. */
148 #ifndef SIZE_TYPE
149 # define SIZE_TYPE "unsigned int"
150 #endif
152 #ifndef PTRDIFF_TYPE
153 # define PTRDIFF_TYPE "int"
154 #endif
156 #ifndef WCHAR_TYPE
157 # define WCHAR_TYPE "long int"
158 #endif
160 #ifndef WCHAR_TYPE_SIZE
161 # define WCHAR_TYPE_SIZE BITS_PER_WORD
162 #endif
164 /* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
165 the .align directive with GAS. */
167 #ifndef ASM_OUTPUT_ALIGN
168 # define ASM_OUTPUT_ALIGN(FILE, LOG) \
169 do \
171 if ((LOG) != 0) \
172 fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \
174 while (0)
175 #endif
177 /* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
178 the default on LynxOS. */
180 #ifndef PREFERRED_DEBUGGING_TYPE
181 # define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
182 #endif
184 /* We have C++ support in our system headers. */
186 #ifndef NO_IMPLICIT_EXTERN_C
187 # define NO_IMPLICIT_EXTERN_C
188 #endif
190 #ifndef TARGET_HAS_F_SETLKW
191 # define TARGET_HAS_F_SETLKW
192 #endif