home *** CD-ROM | disk | FTP | other *** search
/ Fresh Fish 7 / FreshFishVol7.bin / bbs / gnu / gcc-2.3.3-src.lha / GNU / src / amiga / gcc-2.3.3 / config / next.h < prev    next >
C/C++ Source or Header  |  1994-02-06  |  15KB  |  460 lines

  1. /* next.h:  definitions for NeXT.
  2.  
  3. This file is part of GNU CC.
  4.  
  5. GNU CC is free software; you can redistribute it and/or modify
  6. it under the terms of the GNU General Public License as published by
  7. the Free Software Foundation; either version 2, or (at your option)
  8. any later version.
  9.  
  10. GNU CC is distributed in the hope that it will be useful,
  11. but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  13. GNU General Public License for more details.
  14.  
  15. You should have received a copy of the GNU General Public License
  16. along with GNU CC; see the file COPYING.  If not, write to
  17. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  */
  18.  
  19. #include "m68k.h"
  20.  
  21. /* Use new NeXT include file search path.  */
  22.  
  23. #ifndef CROSS_COMPILE /* In a cross compiler with NeXT as target, don't expect
  24.              the host to use Next's directory scheme.  */
  25. #define INCLUDE_DEFAULTS                \
  26.   {                            \
  27.     { GPLUSPLUS_INCLUDE_DIR, 1},            \
  28.     { GCC_INCLUDE_DIR, 0},                \
  29.     { LOCAL_INCLUDE_DIR, 0},                \
  30.     { "/NextDeveloper/Headers", 0},            \
  31.     { "/NextDeveloper/Headers/ansi", 0},        \
  32.     { "/NextDeveloper/Headers/bsd", 0},            \
  33.     { "/LocalDeveloper/Headers", 0},            \
  34.     { "/LocalDeveloper/Headers/ansi", 0},        \
  35.     { "/LocalDeveloper/Headers/bsd", 0},        \
  36.     { "/NextDeveloper/2.0CompatibleHeaders", 0},    \
  37.     { STANDARD_INCLUDE_DIR, 0},                \
  38.     { 0, 0}                        \
  39.   }
  40. #endif /* CROSS_COMPILE */
  41.  
  42. #define EXTRA_FORMAT_FUNCTIONS \
  43.       "NXPrintf",    FALSE,    2,    FALSE,    \
  44.       "NXScanf",    TRUE,    2,    FALSE,    \
  45.       "NXVPrintf",    FALSE,    2,    TRUE,    \
  46.       "NXVScanf",    TRUE,    2,    TRUE,    \
  47.       "DPSPrintf",    FALSE,    2,    FALSE,    \
  48.       "bsd_sprintf",    FALSE,    2,    FALSE,    \
  49.       "bsd_vsprintf",    FALSE,    2,    TRUE,
  50.  
  51. /* Use NeXT's special calling convention for sending an Objc message.  */
  52. #define NEXT_OBJC_RUNTIME
  53.  
  54. /* We have atexit.  */
  55. #define HAVE_ATEXIT
  56.  
  57. /* Enable recent gcc to compile under the old gcc in Next release 1.0.  */
  58. #define __inline inline
  59.  
  60. /* See m68k.h.  0407 means 68040 (or 68030 or 68020, with 68881/2).  */
  61.  
  62. #define TARGET_DEFAULT 0407
  63.  
  64. /* wchar_t is unsigned short */
  65.  
  66. #undef WCHAR_TYPE
  67. #undef WCHAR_TYPE_SIZE
  68. #define WCHAR_TYPE "short unsigned int"
  69. #define WCHAR_TYPE_SIZE (BITS_PER_WORD / 2)
  70.  
  71. /* Give methods pretty symbol names on NeXT. */
  72.  
  73. #define OBJC_GEN_METHOD_LABEL(BUF,IS_INST,CLASS_NAME,CAT_NAME,SEL_NAME)    \
  74.   do { if (CAT_NAME)                            \
  75.      sprintf (BUF, "%c[%s(%s) %s]", (IS_INST) ? '-' : '+',        \
  76.           (CLASS_NAME), (CAT_NAME), (SEL_NAME));        \
  77.        else                                \
  78.      sprintf (BUF, "%c[%s %s]", (IS_INST) ? '-' : '+',        \
  79.           (CLASS_NAME), (SEL_NAME));                \
  80.      } while (0)
  81.  
  82. /* Wrap new method names in quotes so the assembler doesn't gag.
  83.    Make Objective-C internal symbols local.  */
  84.  
  85. #undef ASM_OUTPUT_LABELREF
  86. #define ASM_OUTPUT_LABELREF(FILE,NAME)    \
  87.   do { if (NAME[0] == '+' || NAME[0] == '-') fprintf (FILE, "\"%s\"", NAME); \
  88.        else if (!strncmp (NAME, "_OBJC_", 6)) fprintf (FILE, "L%s", NAME);   \
  89.        else if (!strncmp (NAME, ".objc_class_name_", 17))        \
  90.      fprintf (FILE, "%s", NAME);                    \
  91.        else fprintf (FILE, "_%s", NAME); } while (0)
  92.  
  93. #undef STACK_BOUNDARY
  94. /* Boundary (in *bits*) on which stack pointer should be aligned.  */
  95. #define STACK_BOUNDARY 32
  96.  
  97. /* These compiler options take n arguments.  */
  98.  
  99. #define WORD_SWITCH_TAKES_ARG(STR)         \
  100.   (!strcmp (STR, "Ttext") ? 1 :            \
  101.    !strcmp (STR, "Tdata") ? 1 :            \
  102.    !strcmp (STR, "Tbss") ? 1 :            \
  103.    !strcmp (STR, "include") ? 1 :        \
  104.    !strcmp (STR, "imacros") ? 1 :        \
  105.    !strcmp (STR, "segalign") ? 1 :        \
  106.    !strcmp (STR, "seg1addr") ? 1 :        \
  107.    !strcmp (STR, "segaddr") ? 2 :        \
  108.    !strcmp (STR, "sectobjectsymbols") ? 2 :    \
  109.    !strcmp (STR, "segprot") ? 3 :        \
  110.    !strcmp (STR, "sectcreate") ? 3 :        \
  111.    !strcmp (STR, "sectalign") ? 3 :        \
  112.    !strcmp (STR, "segcreate") ? 3 :        \
  113.    !strcmp (STR, "sectorder") ? 3 :        \
  114.    !strcmp (STR, "aux-info") ? 1 :        \
  115.    0)
  116.  
  117. /* Names to predefine in the preprocessor for this target machine.  */
  118.  
  119. #define CPP_PREDEFINES "-Dmc68000 -Dm68k -DNeXT -Dunix -D__MACH__ -D__ARCHITECTURE__=\"m68k\""
  120.  
  121. /* Machine dependent ccp options.  */
  122.  
  123. /* This option used to be called -bsd, but that conflicts with the
  124.    general -b option.  */
  125. #define CPP_SPEC "%{strict-bsd:-D__STRICT_BSD__}"
  126.  
  127. /* Machine dependent ld options.  */
  128.  
  129. #define LINK_SPEC "%{Z} %{M} \
  130. %{execute*} %{object*} %{preload*} %{fvmlib*} \
  131. %{segalign*} %{seg1addr*} %{segaddr*} %{segprot*} \
  132. %{seglinkedit*} %{noseglinkedit*} \
  133. %{sectcreate*} %{sectalign*} %{sectobjectsymbols}\
  134. %{segcreate*} %{Mach*} %{whyload} %{w} \
  135. %{sectorder*} %{whatsloaded}"
  136.  
  137. /* Machine dependent libraries.  */
  138.  
  139. #define LIB_SPEC "%{!p:%{!pg:-lsys_s}} %{pg:-lsys_p}"
  140.  
  141. /* We specify crt0.o as -lcrt0.o so that ld will search the library path. */
  142. #define STARTFILE_SPEC  \
  143.   "%{pg:-lgcrt0.o}%{!pg: \
  144.      %{p:%e-p profiling is no longer supported.  Use -pg instead.} \
  145.      %{!p:-lcrt0.o}}"
  146.  
  147. /* Every structure or union's size must be a multiple of 2 bytes.
  148.    (Why isn't this in m68k.h?)  */
  149.  
  150. #define STRUCTURE_SIZE_BOUNDARY 16
  151.  
  152. /* Why not? */
  153.  
  154. #define DOLLARS_IN_IDENTIFIERS 2
  155.  
  156. /* Allow #sscs (but don't do anything). */
  157.  
  158. #define SCCS_DIRECTIVE
  159.  
  160. /* We use Dbx symbol format.  */
  161.  
  162. #define DBX_DEBUGGING_INFO
  163.  
  164. /* This saves a fair amount of space. */
  165.  
  166. #define DBX_CONTIN_LENGTH 0
  167.  
  168. /* These screw up NeXT's gdb at the moment, so don't use them. */
  169.  
  170. #define DBX_OUTPUT_MAIN_SOURCE_DIRECTORY(FILE, FILENAME)
  171.  
  172. /* gdb needs a null N_SO at the end of each file for scattered loading. */
  173.  
  174. #define DBX_OUTPUT_MAIN_SOURCE_FILE_END(FILE, FILENAME)            \
  175.   fprintf (FILE,                            \
  176.        "\t.text\n\t.stabs \"%s\",%d,0,0,Letext\nLetext:\n",        \
  177.        "" , N_SO)
  178.  
  179. /* Don't use .gcc_compiled symbols to communicate with GDB;
  180.    They interfere with numerically sorted symbol lists. */
  181.  
  182. #define ASM_IDENTIFY_GCC(asm_out_file)
  183.  
  184. /* This is how to output an assembler line defining a `double' constant.  */
  185.  
  186. #undef ASM_OUTPUT_DOUBLE
  187. #define ASM_OUTPUT_DOUBLE(FILE,VALUE)                    \
  188.   (REAL_VALUE_ISINF ((VALUE))                        \
  189.    ? fprintf (FILE, "\t.double 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
  190.    : fprintf (FILE, "\t.double 0r%.20e\n", (VALUE)))
  191.  
  192. /* This is how to output an assembler line defining a `float' constant.  */
  193.  
  194. #undef ASM_OUTPUT_FLOAT
  195. #define ASM_OUTPUT_FLOAT(FILE,VALUE)                    \
  196.   (REAL_VALUE_ISINF ((VALUE))                        \
  197.    ? fprintf (FILE, "\t.single 0r%s99e999\n", ((VALUE) > 0 ? "" : "-")) \
  198.    : fprintf (FILE, "\t.single 0r%.20e\n", (VALUE)))
  199.  
  200. #undef ASM_OUTPUT_FLOAT_OPERAND
  201. #define ASM_OUTPUT_FLOAT_OPERAND(FILE,VALUE)                \
  202.   (REAL_VALUE_ISINF ((VALUE))                        \
  203.    ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  204.    : fprintf (FILE, "#0r%.9g", (VALUE)))
  205.  
  206. #undef ASM_OUTPUT_DOUBLE_OPERAND
  207. #define ASM_OUTPUT_DOUBLE_OPERAND(FILE,VALUE)                \
  208.   (REAL_VALUE_ISINF ((VALUE))                        \
  209.    ? fprintf (FILE, "#0r%s99e999", ((VALUE) > 0 ? "" : "-")) \
  210.    : fprintf (FILE, "#0r%.20g", (VALUE)))
  211.  
  212. #if 0 /* This is for system verson 3.0, which isn't out yet.  */
  213. #define ASM_OUTPUT_CONSTRUCTOR(FILE,NAME)    \
  214.   do { constructor_section ();            \
  215.        ASM_OUTPUT_ALIGN (FILE, 1);        \
  216.        fprintf (FILE, "\t.long ");        \
  217.        assemble_name (FILE, NAME);        \
  218.        fprintf (FILE, "\n"); } while (0)
  219.  
  220. #define ASM_OUTPUT_DESTRUCTOR(FILE,NAME)    \
  221.   do { destructor_section ();            \
  222.        ASM_OUTPUT_ALIGN (FILE, 1);        \
  223.        fprintf (FILE, "\t.long ");        \
  224.        assemble_name (FILE, NAME);        \
  225.        fprintf (FILE, "\n"); } while (0)
  226. #endif
  227.  
  228. /* How to parse #pragma's */
  229.  
  230. #define HANDLE_PRAGMA(finput) handle_pragma (finput)
  231.  
  232. /* Create new Mach-O sections. */
  233.  
  234. #define SECTION_FUNCTION(FUNCTION, SECTION, DIRECTIVE, WAS_TEXT)    \
  235. void                                    \
  236. FUNCTION ()                                \
  237. {                                    \
  238.   extern void text_section ();                         \
  239.   extern int flag_no_mach_text_sections;                       \
  240.                                       \
  241.   if (WAS_TEXT && flag_no_mach_text_sections)                   \
  242.     text_section ();                            \
  243.   else if (in_section != SECTION)                    \
  244.     {                                    \
  245.       fprintf (asm_out_file, "%s\n", DIRECTIVE);            \
  246.       in_section = SECTION;                        \
  247.     }                                    \
  248. }                                    \
  249.  
  250. #define EXTRA_SECTIONS                    \
  251.   in_const, in_cstring, in_literal4, in_literal8,    \
  252.   in_constructor, in_destructor,            \
  253.   in_objc_class, in_objc_meta_class, in_objc_