1 /* Target independent definitions for LynxOS. 2 Copyright (C) 1993, 1994, 1995, 1996, 1999, 2000, 2002, 2003, 2004 3 Free Software Foundation, Inc. 4 5 This file is part of GCC. 6 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. 11 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. 16 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, 51 Franklin Street, Fifth Floor, 20 Boston, MA 02110-1301, USA. */ 21 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. */ 28 29 #ifndef EXTRA_OS_LYNX_TARGET_SPECS 30 # define EXTRA_OS_LYNX_TARGET_SPECS 31 #endif 32 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 42 43 #ifndef SUBTARGET_EXTRA_SPECS 44 # define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS 45 #endif 46 47 #ifndef CPP_SPEC 48 # define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)" 49 #endif 50 51 #ifndef LIB_SPEC 52 # define LIB_SPEC "%(lib_os_lynx)" 53 #endif 54 55 #ifndef LINK_SPEC 56 # define LINK_SPEC "%(link_os_lynx)" 57 #endif 58 59 #ifndef STARTFILE_SPEC 60 # define STARTFILE_SPEC "%(startfile_os_lynx)" 61 #endif 62 63 #ifndef ENDFILE_SPEC 64 # define ENDFILE_SPEC "%(endfile_os_lynx)" 65 #endif 66 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 76 77 #ifndef LIB_OS_LYNX_SPEC 78 # define LIB_OS_LYNX_SPEC \ 79 "%{mlegacy-threads:-lposix-pre1c} -lm -lc" 80 #endif 81 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. 86 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. */ 92 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 110 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 124 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 131 132 /* Define the actual types of some ANSI-mandated types. */ 133 134 #ifndef SIZE_TYPE 135 # define SIZE_TYPE "unsigned int" 136 #endif 137 138 #ifndef PTRDIFF_TYPE 139 # define PTRDIFF_TYPE "int" 140 #endif 141 142 #ifndef WCHAR_TYPE 143 # define WCHAR_TYPE "long int" 144 #endif 145 146 #ifndef WCHAR_TYPE_SIZE 147 # define WCHAR_TYPE_SIZE BITS_PER_WORD 148 #endif 149 150 /* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that 151 the .align directive with GAS. */ 152 153 #ifndef ASM_OUTPUT_ALIGN 154 # define ASM_OUTPUT_ALIGN(FILE, LOG) \ 155 do \ 156 { \ 157 if ((LOG) != 0) \ 158 fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \ 159 } \ 160 while (0) 161 #endif 162 163 /* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is 164 the default on LynxOS. */ 165 166 #ifndef PREFERRED_DEBUGGING_TYPE 167 # define PREFERRED_DEBUGGING_TYPE DBX_DEBUG 168 #endif 169 170 /* We have C++ support in our system headers. */ 171 172 #ifndef NO_IMPLICIT_EXTERN_C 173 # define NO_IMPLICIT_EXTERN_C 174 #endif 175 176 #ifndef TARGET_POSIX_IO 177 # define TARGET_POSIX_IO 178 #endif 179