lynx.h 4.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177
  1. /* Target independent definitions for LynxOS.
  2. Copyright (C) 1993-2015 Free Software Foundation, Inc.
  3. This file is part of GCC.
  4. GCC is free software; you can redistribute it and/or modify
  5. it under the terms of the GNU General Public License as published by
  6. the Free Software Foundation; either version 3, or (at your option)
  7. any later version.
  8. GCC is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. GNU General Public License for more details.
  12. You should have received a copy of the GNU General Public License
  13. along with GCC; see the file COPYING3. If not see
  14. <http://www.gnu.org/licenses/>. */
  15. /* In this file we set up defaults that can be chosen by
  16. <target>/lynx.h files. A target-specific lynx.h file can decide
  17. either to define and override these definitions or to use them by
  18. ensuring they are undefined at this point. If we were to #undef
  19. them here we might accidentally disable some target-specific
  20. defines. */
  21. #ifndef EXTRA_OS_LYNX_TARGET_SPECS
  22. # define EXTRA_OS_LYNX_TARGET_SPECS
  23. #endif
  24. #ifndef EXTRA_OS_LYNX_SPECS
  25. # define EXTRA_OS_LYNX_SPECS \
  26. { "cpp_os_lynx", CPP_OS_LYNX_SPEC }, \
  27. { "lib_os_lynx", LIB_OS_LYNX_SPEC }, \
  28. { "link_os_lynx", LINK_OS_LYNX_SPEC }, \
  29. { "startfile_os_lynx", STARTFILE_OS_LYNX_SPEC }, \
  30. { "endfile_os_lynx", ENDFILE_OS_LYNX_SPEC }, \
  31. EXTRA_OS_LYNX_TARGET_SPECS
  32. #endif
  33. #ifndef SUBTARGET_EXTRA_SPECS
  34. # define SUBTARGET_EXTRA_SPECS EXTRA_OS_LYNX_SPECS
  35. #endif
  36. #ifndef CPP_SPEC
  37. # define CPP_SPEC "%(cpp_cpu) %(cpp_os_lynx)"
  38. #endif
  39. #ifndef LIB_SPEC
  40. # define LIB_SPEC "%(lib_os_lynx)"
  41. #endif
  42. #ifndef LINK_SPEC
  43. # define LINK_SPEC "%(link_os_lynx)"
  44. #endif
  45. #ifndef STARTFILE_SPEC
  46. # define STARTFILE_SPEC "%(startfile_os_lynx)"
  47. #endif
  48. #ifndef ENDFILE_SPEC
  49. # define ENDFILE_SPEC "%(endfile_os_lynx)"
  50. #endif
  51. #ifndef CPP_OS_LYNX_SPEC
  52. # define CPP_OS_LYNX_SPEC \
  53. "%{mthreads: \
  54. %{mlegacy-threads: \
  55. %ecannot use mthreads and mlegacy-threads together}} \
  56. %{mthreads: -D_MULTITHREADED} \
  57. %{mlegacy-threads: -D_THREADS_POSIX4ad4} \
  58. -Asystem=lynx -Asystem=unix -D__Lynx__ -D__unix__"
  59. #endif
  60. #ifndef LIB_OS_LYNX_SPEC
  61. # define LIB_OS_LYNX_SPEC \
  62. "%{mlegacy-threads:-lposix-pre1c} -lm -lc"
  63. #endif
  64. /* We link static executables for LynxOS by default unless -mshared is
  65. used when linking an executable. Along the same line, we link to
  66. shared libraries when linking a shared object by default unless
  67. -static is used.
  68. We have to pass in our -L options here otherwise the translated
  69. startfile directories (%D) will take priority over this.
  70. Furthermore since we have to pass in -L options here we have to
  71. make sure that -L options provided by the user take priority over
  72. everything we specify. */
  73. #ifndef LINK_OS_LYNX_SPEC
  74. # define LINK_OS_LYNX_SPEC \
  75. "%{shared} %{static} \
  76. %{mshared: %{static: %ecannot use mshared and static together}} \
  77. %{!mshared: %{!shared: %{!static: -static}}} \
  78. %{L*} \
  79. %{mthreads: \
  80. %{mshared: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
  81. %{shared: \
  82. %{!static: -L/lib/thread/shlib -rpath /lib/thread/shlib} \
  83. %{!mshared: -L/lib/thread}} \
  84. %{shared: %{static: -L/lib/thread}}} \
  85. %{!mthreads: \
  86. %{mshared: -L/lib/shlib -rpath /lib/shlib} \
  87. %{shared: -L/lib/shlib -rpath /lib/shlib}} \
  88. %{mlegacy-threads:-lposix-pre1c} -lm -lc"
  89. #endif
  90. #ifndef STARTFILE_OS_LYNX_SPEC
  91. # define STARTFILE_OS_LYNX_SPEC \
  92. "%{!shared: \
  93. %{!mthreads: \
  94. %{p:gcrt1.o%s} %{pg:gcrt1.o%s} \
  95. %{!p:%{!pg:crt1.o%s}}} \
  96. %{mthreads: \
  97. %{p:thread/gcrt1.o%s} %{pg:thread/gcrt1.o%s} \
  98. %{!p:%{!pg:thread/crt1.o%s }}}}\
  99. %{mthreads: thread/crti.o%s} %{!mthreads: crti.o%s} \
  100. %{!shared: crtbegin.o%s} \
  101. %{shared: crtbeginS.o%s}"
  102. #endif
  103. #ifndef ENDFILE_OS_LYNX_SPEC
  104. # define ENDFILE_OS_LYNX_SPEC \
  105. "%{!shared: crtend.o%s} \
  106. %{shared: crtendS.o%s} \
  107. %{mthreads: thread/crtn.o%s} %{!mthreads: crtn.o%s}"
  108. #endif
  109. /* Define the actual types of some ANSI-mandated types. */
  110. #ifndef SIZE_TYPE
  111. # define SIZE_TYPE "unsigned int"
  112. #endif
  113. #ifndef PTRDIFF_TYPE
  114. # define PTRDIFF_TYPE "int"
  115. #endif
  116. #ifndef WCHAR_TYPE
  117. # define WCHAR_TYPE "long int"
  118. #endif
  119. #ifndef WCHAR_TYPE_SIZE
  120. # define WCHAR_TYPE_SIZE BITS_PER_WORD
  121. #endif
  122. /* Define ASM_OUTPUT_ALIGN to use the .balign directive rather that
  123. the .align directive with GAS. */
  124. #ifndef ASM_OUTPUT_ALIGN
  125. # define ASM_OUTPUT_ALIGN(FILE, LOG) \
  126. do \
  127. { \
  128. if ((LOG) != 0) \
  129. fprintf ((FILE), "\t.balign %d\n", 1 << (LOG)); \
  130. } \
  131. while (0)
  132. #endif
  133. /* Keep the *_DEBUGGING_INFO defines from elfos.h except that stabs is
  134. the default on LynxOS. */
  135. #ifndef PREFERRED_DEBUGGING_TYPE
  136. # define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
  137. #endif
  138. /* We have C++ support in our system headers. */
  139. #ifndef NO_IMPLICIT_EXTERN_C
  140. # define NO_IMPLICIT_EXTERN_C
  141. #endif
  142. #ifndef TARGET_POSIX_IO
  143. # define TARGET_POSIX_IO
  144. #endif