lynx.h revision 169690
1186347Snwhitehorn/* Target independent definitions for LynxOS.
2186347Snwhitehorn   Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004
3186347Snwhitehorn   Free Software Foundation, Inc.
4186347Snwhitehorn
5186347SnwhitehornThis file is part of GCC.
6186347Snwhitehorn
7186347SnwhitehornGCC is free software; you can redistribute it and/or modify
8186347Snwhitehornit under the terms of the GNU General Public License as published by
9186347Snwhitehornthe Free Software Foundation; either version 2, or (at your option)
10186347Snwhitehornany later version.
11186347Snwhitehorn
12186347SnwhitehornGCC is distributed in the hope that it will be useful,
13186347Snwhitehornbut WITHOUT ANY WARRANTY; without even the implied warranty of
14186347SnwhitehornMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
15186347SnwhitehornGNU General Public License for more details.
16186347Snwhitehorn
17186347SnwhitehornYou should have received a copy of the GNU General Public License
18186347Snwhitehornalong with GCC; see the file COPYING.  If not, write to
19186347Snwhitehornthe Free Software Foundation, 51 Franklin Street, Fifth Floor,
20186347SnwhitehornBoston, MA 02110-1301, USA.  */
21186347Snwhitehorn
22186347Snwhitehorn/* In this file we set up defaults that can be chosen by
23186347Snwhitehorn   <target>/lynx.h files.  A target-specific lynx.h file can decide
24186347Snwhitehorn   either to define and override these definitions or to use them by
25186347Snwhitehorn   ensuring they are undefined at this point.  If we were to #undef
26186347Snwhitehorn   them here we might accidentally disable some target-specific
27186347Snwhitehorn   defines.  */
28186347Snwhitehorn
29186347Snwhitehorn#ifndef EXTRA_OS_LYNX_TARGET_SPECS
30186347Snwhitehorn# define EXTRA_OS_LYNX_TARGET_SPECS
31186347Snwhitehorn#endif
32186347Snwhitehorn
33186347Snwhitehorn#ifndef EXTRA_OS_LYNX_SPECS
34186347Snwhitehorn# define EXTRA_OS_LYNX_SPECS \
35194138Smarius  { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
36186347Snwhitehorn  { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
37186347Snwhitehorn  { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
38186347Snwhitehorn  { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
39186347Snwhitehorn  { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
40186347Snwhitehorn  EXTRA_OS_LYNX_TARGET_SPECS
41186347Snwhitehorn#endif
42186347Snwhitehorn
43186347Snwhitehorn#ifndef SUBTARGET_EXTRA_SPECS
44186347Snwhitehorn# define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
45186347Snwhitehorn#endif
46208614Sraj
47186347Snwhitehorn#ifndef CPP_SPEC
48186347Snwhitehorn# define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
49186347Snwhitehorn#endif
50186347Snwhitehorn
51186347Snwhitehorn#ifndef LIB_SPEC
52194138Smarius# define LIB_SPEC "%(lib_os_lynx)"
53186347Snwhitehorn#endif
54186347Snwhitehorn
55186347Snwhitehorn#ifndef LINK_SPEC
56186347Snwhitehorn# define LINK_SPEC "%(link_os_lynx)"
57186347Snwhitehorn#endif
58194138Smarius
59186347Snwhitehorn#ifndef STARTFILE_SPEC
60186347Snwhitehorn# define STARTFILE_SPEC "%(startfile_os_lynx)"
61186347Snwhitehorn#endif
62194138Smarius
63186347Snwhitehorn#ifndef ENDFILE_SPEC
64186347Snwhitehorn# define ENDFILE_SPEC "%(endfile_os_lynx)"
65186347Snwhitehorn#endif
66186347Snwhitehorn
67186347Snwhitehorn#ifndef CPP_OS_LYNX_SPEC
68194138Smarius# define CPP_OS_LYNX_SPEC \
69186347Snwhitehorn"%{mthreads: \
70186347Snwhitehorn   %{mlegacy-threads: \
71186347Snwhitehorn     %ecannot use mthreads and mlegacy-threads together}} \
72194138Smarius %{mthreads: -D_MULTITHREADED} \
73186347Snwhitehorn %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
74186347Snwhitehorn -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
75186347Snwhitehorn#endif
76186347Snwhitehorn
77186347Snwhitehorn#ifndef LIB_OS_LYNX_SPEC
78194138Smarius# define LIB_OS_LYNX_SPEC \
79186347Snwhitehorn"%{mlegacy-threads:-lposix-pre1c} -lm -lc"
80186347Snwhitehorn#endif
81186347Snwhitehorn
82194138Smarius/* We link static executables for LynxOS by default unless -mshared is
83186347Snwhitehorn   used when linking an executable.  Along the same line, we link to
84186347Snwhitehorn   shared libraries when linking a shared object by default unless
85186347Snwhitehorn   -static is used.
86186347Snwhitehorn
87186347Snwhitehorn   We have to pass in our -L options here otherwise the translated
88194138Smarius   startfile directories (%D) will take priority over this.
89186347Snwhitehorn   Furthermore since we have to pass in -L options here we have to
90186347Snwhitehorn   make sure that -L options provided by the user take priority over
91186347Snwhitehorn   everything we specify.  */
92194138Smarius
93186347Snwhitehorn#ifndef LINK_OS_LYNX_SPEC
94186347Snwhitehorn# define LINK_OS_LYNX_SPEC \
95186347Snwhitehorn"%{shared} %{static} \
96186347Snwhitehorn %{mshared: %{static: %ecannot use mshared and static together}} \
97186347Snwhitehorn %{!mshared: %{!shared: %{!static: -static}}} \
98186347Snwhitehorn %{L*} \
99194138Smarius %{mthreads: \
100194138Smarius   %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
101186347Snwhitehorn   %{shared: \
102186347Snwhitehorn     %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
103186347Snwhitehorn   %{!mshared: -L/lib/thread}} \
104194138Smarius   %{shared: %{static: -L/lib/thread}}} \
105186347Snwhitehorn %{!mthreads: \
106186347Snwhitehorn   %{mshared: -L/lib/shlib -rpath /lib/shlib} \
107186347Snwhitehorn   %{shared: -L/lib/shlib -rpath /lib/shlib}} \
108186347Snwhitehorn %{mlegacy-threads:-lposix-pre1c} -lm -lc"
109186347Snwhitehorn#endif
110186347Snwhitehorn
111186347Snwhitehorn#ifndef STARTFILE_OS_LYNX_SPEC
112186347Snwhitehorn# define STARTFILE_OS_LYNX_SPEC \
113194138Smarius"%{!shared: \
114186347Snwhitehorn   %{!mthreads: \
115186347Snwhitehorn     %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
116186347Snwhitehorn     %{!p:%{!pg:crt1.o%s}}} \
117186347Snwhitehorn   %{mthreads: \
118186347Snwhitehorn     %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
119186347Snwhitehorn     %{!p:%{!pg:thread/crt1.o%s }}}}\
120194138Smarius %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
121186347Snwhitehorn %{!shared: crtbegin.o%s} \
122186347Snwhitehorn %{shared: crtbeginS.o%s}"
123186347Snwhitehorn#endif
124186347Snwhitehorn
125186347Snwhitehorn#ifndef ENDFILE_OS_LYNX_SPEC
126186347Snwhitehorn# define ENDFILE_OS_LYNX_SPEC \
127186347Snwhitehorn"%{!shared: crtend.o%s} \
128186347Snwhitehorn %{shared: crtendS.o%s} \
129194138Smarius %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
130186347Snwhitehorn#endif
131194138Smarius
132186347Snwhitehorn/* Define the actual types of some ANSI-mandated types.  */
133186347Snwhitehorn
134186347Snwhitehorn#ifndef SIZE_TYPE
135186347Snwhitehorn# define SIZE_TYPE "unsigned int"
136194138Smarius#endif
137186347Snwhitehorn
138186347Snwhitehorn#ifndef  PTRDIFF_TYPE
139186347Snwhitehorn# define PTRDIFF_TYPE "int"
140186347Snwhitehorn#endif
141186347Snwhitehorn
142186347Snwhitehorn#ifndef  WCHAR_TYPE
143186347Snwhitehorn# define WCHAR_TYPE "long int"
144186347Snwhitehorn#endif
145194138Smarius
146194138Smarius#ifndef  WCHAR_TYPE_SIZE
147186347Snwhitehorn# define WCHAR_TYPE_SIZE BITS_PER_WORD
148186347Snwhitehorn#endif
149186347Snwhitehorn
150186347Snwhitehorn/* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
151186347Snwhitehorn   the .align directive with GAS.  */
152194138Smarius
153186347Snwhitehorn#ifndef ASM_OUTPUT_ALIGN
154186347Snwhitehorn# define ASM_OUTPUT_ALIGN(FILE, LOG) 			\
155186347Snwhitehorn  do							\
156186347Snwhitehorn    {							\
157186347Snwhitehorn      if ((LOG) != 0)					\
158186347Snwhitehorn	fprintf ((FILE), "\t.balign %d\n", 1 << (LOG));	\
159186347Snwhitehorn    }							\
160186347Snwhitehorn  while (0)
161186347Snwhitehorn#endif
162186347Snwhitehorn
163186347Snwhitehorn/* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
164186347Snwhitehorn   the default on LynxOS.  */
165186347Snwhitehorn
166194138Smarius#ifndef PREFERRED_DEBUGGING_TYPE
167186347Snwhitehorn# define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
168186347Snwhitehorn#endif
169186347Snwhitehorn
170186347Snwhitehorn/* We have C++ support in our system headers.  */
171186347Snwhitehorn
172194138Smarius#ifndef NO_IMPLICIT_EXTERN_C
173186347Snwhitehorn# define NO_IMPLICIT_EXTERN_C
174186347Snwhitehorn#endif
175186347Snwhitehorn
176194138Smarius#ifndef TARGET_POSIX_IO
177186347Snwhitehorn# define TARGET_POSIX_IO
178186347Snwhitehorn#endif
179186347Snwhitehorn