home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 6 / FreshFish_September1994.bin / bbs / gnu / gcc-2.6.0-src.lha / GNU / src / amiga / gcc-2.6.0 / config / lynx.h < prev    next >
Encoding:
C/C++ Source or Header  |  1994-07-12  |  5.2 KB  |  172 lines

  1. /* Target independent definitions for LynxOS.
  2.    Copyright (C) 1993 Free Software Foundation, Inc.
  3.  
  4. This file is part of GNU CC.
  5.  
  6. GNU CC is free software; you can redistribute it and/or modify
  7. it under the terms of the GNU General Public License as published by
  8. the Free Software Foundation; either version 2, or (at your option)
  9. any later version.
  10.  
  11. GNU CC is distributed in the hope that it will be useful,
  12. but WITHOUT ANY WARRANTY; without even the implied warranty of
  13. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  14. GNU General Public License for more details.
  15.  
  16. You should have received a copy of the GNU General Public License
  17. along with GNU CC; see the file COPYING.  If not, write to
  18. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  19.  
  20. /* LynxOS is a multi-platform Unix, similar to SVR3, but not identical.
  21.    We can get quite a bit from generic svr3, but have to do some overrides. */
  22.  
  23. #include "svr3.h"
  24.  
  25. /* Define various macros, depending on the combination of flags. */
  26.  
  27. #undef CPP_SPEC
  28. #define CPP_SPEC "%{mthreads:-D_MULTITHREADED}  \
  29.   %{mposix:-D_POSIX_SOURCE}  \
  30.   %{msystem-v:-I/usr/include_v}"
  31.  
  32. /* No asm spec needed, since using GNU assembler always. */
  33.  
  34. /* No linker spec needed, since using GNU linker always. */
  35.  
  36. #undef LIB_SPEC
  37. #define LIB_SPEC "%{mthreads:-L/lib/thread/}  \
  38.   %{msystem-v:-lc_v}  \
  39.   %{!msystem-v:%{mposix:-lc_p} -lc}"
  40.  
  41. /* Set the appropriate names for the Lynx startfiles. */
  42.  
  43. #undef STARTFILE_SPEC
  44. #define STARTFILE_SPEC "%{p:pinit1.o%s}%{!p:%{msystem-v:vinit1.o%s}%{!msystem-v:init1.o%s}}"
  45.  
  46. #undef ENDFILE_SPEC
  47. #define ENDFILE_SPEC "%{p:_etext.o%s}%{!p:initn.o%s}"
  48.  
  49. /* Override the svr3 versions. */
  50.  
  51. #undef WCHAR_TYPE
  52. #define WCHAR_TYPE "int"
  53.  
  54. #undef PTRDIFF_TYPE
  55. #define PTRDIFF_TYPE "long int"
  56.  
  57. /* We want to output DBX (stabs) debugging information normally.  */
  58.  
  59. #define DBX_DEBUGGING_INFO
  60. #define PREFERRED_DEBUGGING_TYPE DBX_DEBUG
  61.  
  62. /* It is convenient to be able to generate standard coff debugging
  63.    if requested via -gcoff. */
  64.  
  65. #define SDB_DEBUGGING_INFO
  66.  
  67. /* Be function-relative for block and source line stab directives. */
  68.  
  69. #define DBX_BLOCKS_FUNCTION_RELATIVE 1
  70.  
  71. /* but, to make this work, functions must appear prior to line info */
  72.  
  73. #define DBX_FUNCTION_FIRST
  74.  
  75. /* Generate a blank trailing N_SO to mark the end of the .o file, since
  76.    we can't depend upon the linker to mark .o file boundaries with
  77.    embedded stabs.  */
  78.  
  79. #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)            \
  80.   fprintf (FILE,                            \
  81.        "\t.text\n\t.stabs \"\",%d,0,0,Letext\nLetext:\n", N_SO)
  82.  
  83. #undef  ASM_OUTPUT_SOURCE_LINE
  84. #define ASM_OUTPUT_SOURCE_LINE(file, line)        \
  85.   { static int sym_lineno = 1;                \
  86.     fprintf (file, ".stabn 68,0,%d,.LM%d-%s\n.LM%d:\n",    \
  87.          line, sym_lineno,                 \
  88.          XSTR (XEXP (DECL_RTL (current_function_decl), 0), 0), \
  89.          sym_lineno);                \
  90.     sym_lineno += 1; }
  91.  
  92. /* Handle #pragma pack and sometimes #pragma weak.  */
  93.  
  94. #define HANDLE_SYSV_PRAGMA
  95.  
  96. /* Some additional command-line options. */
  97.  
  98. #define TARGET_THREADS    (target_flags & MASK_THREADS)
  99. #define MASK_THREADS    0x40000000
  100.  
  101. #define TARGET_POSIX    (target_flags & MASK_POSIX)
  102. #define MASK_POSIX    0x20000000
  103.  
  104. #define TARGET_SYSTEM_V    (target_flags & MASK_SYSTEM_V)
  105. #define MASK_SYSTEM_V    0x10000000
  106.  
  107. #undef SUBTARGET_SWITCHES
  108. #define SUBTARGET_SWITCHES \
  109.     {"threads",        MASK_THREADS},        \
  110.     {"posix",        MASK_POSIX},        \
  111.     {"system-v",    MASK_SYSTEM_V},
  112.  
  113. #undef SUBTARGET_OVERRIDE_OPTIONS
  114. #define SUBTARGET_OVERRIDE_OPTIONS \
  115. { if (TARGET_SYSTEM_V && profile_flag)            \
  116.     warning ("-msystem-v and -p are incompatible");        \
  117.   if (TARGET_SYSTEM_V && TARGET_THREADS)            \
  118.     warning ("-msystem-v and -mthreads are incompatible"); }
  119.  
  120. /* Define this so that C++ destructors will use atexit, since LynxOS
  121.    calls exit after main returns.  */
  122.  
  123. #define HAVE_ATEXIT
  124.  
  125. /* Since init.o et al put all sorts of stuff into the init section,
  126.    we can't use the standard init section support in crtbegin.o. */
  127.  
  128. #undef INIT_SECTION_ASM_OP
  129.  
  130. #undef EXTRA_SECTIONS
  131. #define EXTRA_SECTIONS in_const, in_bss, in_ctors, in_dtors, in_fini,
  132.  
  133. #undef EXTRA_SECTION_FUNCTIONS
  134. #define EXTRA_SECTION_FUNCTIONS                    \
  135.   CONST_SECTION_FUNCTION                    \
  136.   BSS_SECTION_FUNCTION                        \
  137.   CTORS_SECTION_FUNCTION                    \
  138.   DTORS_SECTION_FUNCTION                    \
  139.   FINI_SECTION_FUNCTION
  140.  
  141. #undef CTORS_SECTION_ASM_OP
  142. #define CTORS_SECTION_ASM_OP    ".section\t.ctors"
  143. #undef DTORS_SECTION_ASM_OP
  144. #define DTORS_SECTION_ASM_OP    ".section\t.dtors"
  145.  
  146. #define INT_ASM_OP        ".long"
  147.  
  148. /* A C statement (sans semicolon) to output an element in the table of
  149.    global constructors.  */
  150. #undef ASM_OUTPUT_CONSTRUCTOR
  151. #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)                \
  152.   do {                                    \
  153.     ctors_section ();                            \
  154.     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                \
  155.     assemble_name (FILE, NAME);                        \
  156.     fprintf (FILE, "\n");                        \
  157.   } while (0)
  158.  
  159. /* A C statement (sans semicolon) to output an element in the table of
  160.    global destructors.  */
  161. #undef ASM_OUTPUT_DESTRUCTOR
  162. #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)                       \
  163.   do {                                    \
  164.     dtors_section ();                                   \
  165.     fprintf (FILE, "\t%s\t ", INT_ASM_OP);                \
  166.     assemble_name (FILE, NAME);                              \
  167.     fprintf (FILE, "\n");                        \
  168.   } while (0)
  169.  
  170. #undef DO_GLOBAL_CTORS_BODY
  171. #undef DO_GLOBAL_DTORS_BODY
  172.