1214501Srpaulo/* Target independent definitions for LynxOS.
2214501Srpaulo   Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004
3214501Srpaulo   Free Software Foundation, Inc.
4214501Srpaulo
5214501SrpauloThis file is part of GCC.
6252190Srpaulo
7252190SrpauloGCC is free software; you can redistribute it and/or modify
8214501Srpauloit under the terms of the GNU General Public License as published by
9214501Srpaulothe Free Software Foundation; either version 2, or (at your option)
10214501Srpauloany later version.
11214501Srpaulo
12214501SrpauloGCC is distributed in the hope that it will be useful,
13214501Srpaulobut WITHOUT ANY WARRANTY; without even the implied warranty of
14214501SrpauloMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15214501SrpauloGNU General Public License for more details.
16214501Srpaulo
17214501SrpauloYou should have received a copy of the GNU General Public License
18252190Srpauloalong with GCC; see the file COPYING.  If not, write to
19214501Srpaulothe Free Software Foundation, 51 Franklin Street, Fifth Floor,
20214501SrpauloBoston, MA 02110-1301, USA.  */
21252190Srpaulo
22252190Srpaulo/* In this file we set up defaults that can be chosen by
23252190Srpaulo   <target>/lynx.h files.  A target-specific lynx.h file can decide
24252190Srpaulo   either to define and override these definitions or to use them by
25214501Srpaulo   ensuring they are undefined at this point.  If we were to #undef
26252190Srpaulo   them here we might accidentally disable some target-specific
27214501Srpaulo   defines.  */
28214501Srpaulo
29214501Srpaulo#ifndef EXTRA_OS_LYNX_TARGET_SPECS
30252190Srpaulo# define EXTRA_OS_LYNX_TARGET_SPECS
31252190Srpaulo#endif
32252190Srpaulo
33252190Srpaulo#ifndef EXTRA_OS_LYNX_SPECS
34214501Srpaulo# define EXTRA_OS_LYNX_SPECS \
35252190Srpaulo  { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
36252190Srpaulo  { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
37252190Srpaulo  { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
38214501Srpaulo  { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
39252190Srpaulo  { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
40252190Srpaulo  EXTRA_OS_LYNX_TARGET_SPECS
41252190Srpaulo#endif
42252190Srpaulo
43252190Srpaulo#ifndef SUBTARGET_EXTRA_SPECS
44252190Srpaulo# define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
45252190Srpaulo#endif
46252190Srpaulo
47252190Srpaulo#ifndef CPP_SPEC
48252190Srpaulo# define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
49252190Srpaulo#endif
50252190Srpaulo
51252190Srpaulo#ifndef LIB_SPEC
52252190Srpaulo# define LIB_SPEC "%(lib_os_lynx)"
53214501Srpaulo#endif
54252190Srpaulo
55252190Srpaulo#ifndef LINK_SPEC
56252190Srpaulo# define LINK_SPEC "%(link_os_lynx)"
57214501Srpaulo#endif
58252190Srpaulo
59214501Srpaulo#ifndef STARTFILE_SPEC
60214501Srpaulo# define STARTFILE_SPEC "%(startfile_os_lynx)"
61252190Srpaulo#endif
62214501Srpaulo
63214501Srpaulo#ifndef ENDFILE_SPEC
64214501Srpaulo# define ENDFILE_SPEC "%(endfile_os_lynx)"
65214501Srpaulo#endif
66214501Srpaulo
67214501Srpaulo#ifndef CPP_OS_LYNX_SPEC
68214501Srpaulo# define CPP_OS_LYNX_SPEC \
69214501Srpaulo"%{mthreads: \
70214501Srpaulo   %{mlegacy-threads: \
71214501Srpaulo     %ecannot use mthreads and mlegacy-threads together}} \
72214501Srpaulo %{mthreads: -D_MULTITHREADED} \
73214501Srpaulo %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
74214501Srpaulo -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
75214501Srpaulo#endif
76214501Srpaulo
77252190Srpaulo#ifndef LIB_OS_LYNX_SPEC
78252190Srpaulo# define LIB_OS_LYNX_SPEC \
79214501Srpaulo"%{mlegacy-threads:-lposix-pre1c} -lm -lc"
80252190Srpaulo#endif
81214501Srpaulo
82252190Srpaulo/* We link static executables for LynxOS by default unless -mshared is
83214501Srpaulo   used when linking an executable.  Along the same line, we link to
84252190Srpaulo   shared libraries when linking a shared object by default unless
85252190Srpaulo   -static is used.
86252190Srpaulo
87252190Srpaulo   We have to pass in our -L options here otherwise the translated
88252190Srpaulo   startfile directories (%D) will take priority over this.
89252190Srpaulo   Furthermore since we have to pass in -L options here we have to
90252190Srpaulo   make sure that -L options provided by the user take priority over
91214501Srpaulo   everything we specify.  */
92252190Srpaulo
93252190Srpaulo#ifndef LINK_OS_LYNX_SPEC
94252190Srpaulo# define LINK_OS_LYNX_SPEC \
95252190Srpaulo"%{shared} %{static} \
96252190Srpaulo %{mshared: %{static: %ecannot use mshared and static together}} \
97252190Srpaulo %{!mshared: %{!shared: %{!static: -static}}} \
98252190Srpaulo %{L*} \
99252190Srpaulo %{mthreads: \
100214501Srpaulo   %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
101252190Srpaulo   %{shared: \
102252190Srpaulo     %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
103252190Srpaulo   %{!mshared: -L/lib/thread}} \
104252190Srpaulo   %{shared: %{static: -L/lib/thread}}} \
105214501Srpaulo %{!mthreads: \
106252190Srpaulo   %{mshared: -L/lib/shlib -rpath /lib/shlib} \
107252190Srpaulo   %{shared: -L/lib/shlib -rpath /lib/shlib}} \
108252190Srpaulo %{mlegacy-threads:-lposix-pre1c} -lm -lc"
109252190Srpaulo#endif
110252190Srpaulo
111252190Srpaulo#ifndef STARTFILE_OS_LYNX_SPEC
112214501Srpaulo# define STARTFILE_OS_LYNX_SPEC \
113214501Srpaulo"%{!shared: \
114252190Srpaulo   %{!mthreads: \
115214501Srpaulo     %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
116214501Srpaulo     %{!p:%{!pg:crt1.o%s}}} \
117214501Srpaulo   %{mthreads: \
118214501Srpaulo     %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
119214501Srpaulo     %{!p:%{!pg:thread/crt1.o%s }}}}\
120214501Srpaulo %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
121214501Srpaulo %{!shared: crtbegin.o%s} \
122214501Srpaulo %{shared: crtbeginS.o%s}"
123214501Srpaulo#endif
124214501Srpaulo
125214501Srpaulo#ifndef ENDFILE_OS_LYNX_SPEC
126214501Srpaulo# define ENDFILE_OS_LYNX_SPEC \
127214501Srpaulo"%{!shared: crtend.o%s} \
128214501Srpaulo %{shared: crtendS.o%s} \
129214501Srpaulo %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
130214501Srpaulo#endif
131214501Srpaulo
132214501Srpaulo/* Define the actual types of some ANSI-mandated types.  */
133214501Srpaulo
134214501Srpaulo#ifndef SIZE_TYPE
135214501Srpaulo# define SIZE_TYPE "unsigned int"
136214501Srpaulo#endif
137214501Srpaulo
138214501Srpaulo#ifndef  PTRDIFF_TYPE
139214501Srpaulo# define PTRDIFF_TYPE "int"
140214501Srpaulo#endif
141214501Srpaulo
142214501Srpaulo#ifndef  WCHAR_TYPE
143214501Srpaulo# define WCHAR_TYPE "long int"
144214501Srpaulo#endif
145214501Srpaulo
146214501Srpaulo#ifndef  WCHAR_TYPE_SIZE
147214501Srpaulo# define WCHAR_TYPE_SIZE BITS_PER_WORD
148214501Srpaulo#endif
149214501Srpaulo
150214501Srpaulo/* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
151214501Srpaulo   the .align directive with GAS.  */
152214501Srpaulo
153214501Srpaulo#ifndef ASM_OUTPUT_ALIGN
154214501Srpaulo# define ASM_OUTPUT_ALIGN(FILE, LOG) 			\
155214501Srpaulo  do							\
156214501Srpaulo    {							\
157214501Srpaulo      if ((LOG) != 0)					\
158214501Srpaulo	fprintf ((FILE), "\t.balign %d\n", 1 << (LOG));	\
159214501Srpaulo    }							\
160214501Srpaulo  while (0)
161252190Srpaulo#endif
162252190Srpaulo
163252190Srpaulo/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
164252190Srpaulo   the default on LynxOS.  */
165252190Srpaulo
166214501Srpaulo#ifndef PREFERRED_DEBUGGING_TYPE
167214501Srpaulo# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
168252190Srpaulo#endif
169214501Srpaulo
170252190Srpaulo/* We have C++ support in our system headers.  */
171252190Srpaulo
172252190Srpaulo#ifndef NO_IMPLICIT_EXTERN_C
173252190Srpaulo# define NO_IMPLICIT_EXTERN_C
174214501Srpaulo#endif
175252190Srpaulo
176252190Srpaulo#ifndef TARGET_POSIX_IO
177252190Srpaulo# define TARGET_POSIX_IO
178252190Srpaulo#endif
179252190Srpaulo