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 / svr4.h < prev    next >
Text File  |  1994-02-06  |  28KB  |  754 lines

  1. /* svr4.h  --  operating system specific defines to be used when
  2.    targeting GCC for some generic System V Release 4 system.
  3.    Copyright (C) 1991 Free Software Foundation, Inc.
  4.  
  5.    Written by Ron Guilmette (rfg@ncd.com).
  6.  
  7. This file is part of GNU CC.
  8.  
  9. GNU CC is free software; you can redistribute it and/or modify
  10. it under the terms of the GNU General Public License as published by
  11. the Free Software Foundation; either version 2, or (at your option)
  12. any later version.
  13.  
  14. GNU CC is distributed in the hope that it will be useful,
  15. but WITHOUT ANY WARRANTY; without even the implied warranty of
  16. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
  17. GNU General Public License for more details.
  18.  
  19. You should have received a copy of the GNU General Public License
  20. along with GNU CC; see the file COPYING.  If not, write to
  21. the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
  22.  
  23.    To use this file, make up a file with a name like:
  24.  
  25.     ?????svr4.h
  26.  
  27.    where ????? is replaced by the name of the basic hardware that you
  28.    are targeting for.  Then, in the file ?????svr4.h, put something
  29.    like:
  30.  
  31.     #include "?????.h"
  32.     #include "svr4.h"
  33.  
  34.    followed by any really system-specific defines (or overrides of
  35.    defines) which you find that you need.  For example, CPP_PREDEFINES
  36.    is defined here with only the defined -Dunix and -DSVR4.  You should
  37.    probably override that in your target-specific ?????svr4.h file
  38.    with a set of defines that includes these, but also contains an
  39.    appropriate define for the type of hardware that you are targeting.
  40. */
  41.  
  42. /* Define a symbol indicating that we are using svr4.h.  */
  43. #define USING_SVR4_H
  44.  
  45. /* For the sake of libgcc2.c, indicate target supports atexit.  */
  46. #define HAVE_ATEXIT
  47.  
  48. /* Cpp, assembler, linker, library, and startfile spec's.  */
  49.  
  50. /* This defines which switch letters take arguments.  On svr4, most of
  51.    the normal cases (defined in gcc.c) apply, and we also have -h* and
  52.    -z* options (for the linker).  Note however that there is no such
  53.    thing as a -T option for svr4.  */
  54.  
  55. #define SWITCH_TAKES_ARG(CHAR) \
  56.   (   (CHAR) == 'D' \
  57.    || (CHAR) == 'U' \
  58.    || (CHAR) == 'o' \
  59.    || (CHAR) == 'e' \
  60.    || (CHAR) == 'u' \
  61.    || (CHAR) == 'I' \
  62.    || (CHAR) == 'm' \
  63.    || (CHAR) == 'L' \
  64.    || (CHAR) == 'A' \
  65.    || (CHAR) == 'h' \
  66.    || (CHAR) == 'z')
  67.  
  68. /* This defines which multi-letter switches take arguments.  On svr4,
  69.    there are no such switches except those implemented by GCC itself.  */
  70.  
  71. #define WORD_SWITCH_TAKES_ARG(STR)            \
  72.  (!strcmp (STR, "include") || !strcmp (STR, "imacros")    \
  73.   || !strcmp (STR, "aux-info"))
  74.  
  75. /* You should redefine CPP_PREDEFINES in any file which includes this one.
  76.    The definition should be appropriate for the type of target system
  77.    involved, and it should include any -A (assertion) options which are
  78.    appropriate for the given target system.  */
  79. #undef CPP_PREDEFINES
  80.  
  81. /* Provide an ASM_SPEC appropriate for svr4.  Here we try to support as
  82.    many of the specialized svr4 assembler options as seems reasonable,
  83.    given that there are certain options which we can't (or shouldn't)
  84.    support directly due to the fact that they conflict with other options 
  85.    for other svr4 tools (e.g. ld) or with other options for GCC itself.
  86.    For example, we don't support the -o (output file) or -R (remove
  87.    input file) options because GCC already handles these things.  We
  88.    also don't support the -m (run m4) option for the assembler because
  89.    that conflicts with the -m (produce load map) option of the svr4
  90.    linker.  We do however allow passing arbitrary options to the svr4
  91.    assembler via the -Wa, option.
  92.  
  93.    Note that gcc doesn't allow a space to follow -Y in a -Ym,* or -Yd,*
  94.    option.
  95. */
  96.  
  97. #undef ASM_SPEC
  98. #define ASM_SPEC \
  99.   "%{V} %{v:%{!V:-V}} %{Qy:} %{!Qn:-Qy} %{n} %{T} %{Ym,*} %{Yd,*} %{Wa,*:%*}"
  100.  
  101. /* svr4 assemblers need the `-' (indicating input from stdin) to come after
  102.    the -o option (and its argument) for some reason.  If we try to put it
  103.    before the -o option, the assembler will try to read the file named as
  104.    the output file in the -o option as an input file (after it has already
  105.    written some stuff to it) and the binary stuff contained therein will
  106.    cause totally confuse the assembler, resulting in many spurious error
  107.    messages.  */
  108.  
  109. #undef ASM_FINAL_SPEC
  110. #define ASM_FINAL_SPEC "%{pipe:-}"
  111.  
  112. /* Under svr4, the normal location of the `ld' and `as' programs is the
  113.    /usr/ccs/bin directory.  */
  114.  
  115. #undef MD_EXEC_PREFIX
  116. #define MD_EXEC_PREFIX "/usr/ccs/bin/"
  117.  
  118. /* Under svr4, the normal location of the various *crt*.o files is the
  119.    /usr/ccs/lib directory.  */
  120.  
  121. #undef MD_STARTFILE_PREFIX
  122. #define MD_STARTFILE_PREFIX "/usr/ccs/lib/"
  123.  
  124. /* Provide a LIB_SPEC appropriate for svr4.  Here we tack on the default
  125.    standard C library (unless we are building a shared library) followed by
  126.    our own magical crtend.o file (see crtstuff.c) which provides part of
  127.    the support for getting C++ file-scope static object constructed before
  128.    entering `main', followed by the normal svr3/svr4 "finalizer" file,
  129.    which is either `gcrtn.o' or `crtn.o'.  */
  130.  
  131. #undef    LIB_SPEC
  132. #define LIB_SPEC \
  133.   "%{!shared:%{!symbolic:-lc}} \
  134.   crtend.o%s \
  135.   %{!shared:%{!symbolic:%{pg:gcrtn.o}%{!pg:crtn.o%s}}}"
  136.  
  137. /* Provide a LINK_SPEC appropriate for svr4.  Here we provide support
  138.    for the special GCC options -static, -shared, and -symbolic which
  139.    allow us to link things in one of these three modes by applying the
  140.    appropriate combinations of options at link-time.  We also provide
  141.    support here for as many of the other svr4 linker options as seems
  142.    reasonable, given that some of them conflict with options for other
  143.    svr4 tools (e.g. the assembler).  In particular, we do support the
  144.    -h*, -z*, -V, -b, -t, -Qy, -Qn, and -YP* options here, and the -e*,
  145.    -l*, -o*, -r, -s, -u*, and -L* options are directly supported
  146.    by gcc.c itself.  We don't directly support the -m (generate load
  147.    map) option because that conflicts with the -m (run m4) option of
  148.    the svr4 assembler.  We also don't directly support the svr4 linker's
  149.    -I* or -M* options because these conflict with existing GCC options.
  150.    We do however allow passing arbitrary options to the svr4 linker
  151.    via the -Wl, option.  We don't support the svr4 linker's -a option
  152.    at all because it is totally useless and because it conflicts with
  153.    GCC's own -a option.
  154.  
  155.    Note that gcc doesn't allow a space to follow -Y in a -YP,* option.
  156.  
  157.    When the -G link option is used (-shared and -symbolic) a final link is
  158.    not being done.  */
  159.  
  160. #undef    LINK_SPEC
  161. #define LINK_SPEC "%{h*} %{V} %{v:%{!V:-V}} \
  162.            %{b} %{Wl,*:%*} \
  163.            %{static:-dn -Bstatic} \
  164.            %{shared:-G -dy} \
  165.            %{symbolic:-Bsymbolic -G -dy} \
  166.            %{G:-G} \
  167.            %{YP,*} \
  168.            %{!YP,*:%{p:-Y P,/usr/ccs/lib/libp:/usr/lib/libp:/usr/ccs/lib:/usr/lib} \
  169.             %{!p:-Y P,/usr/ccs/lib:/usr/lib}} \
  170.            %{Qy:} %{!Qn:-Qy}"
  171.  
  172. /* Gcc automatically adds in one of the files /usr/ccs/lib/values-Xc.o,
  173.    /usr/ccs/lib/values-Xa.o, or /usr/ccs/lib/values-Xt.o for each final
  174.    link step (depending upon the other gcc options selected, such as
  175.    -traditional and -ansi).  These files each contain one (initialized)
  176.    copy of a special variable called `_lib_version'.  Each one of these
  177.    files has `_lib_version' initialized to a different (enum) value.
  178.    The SVR4 library routines query the value of `_lib_version' at run
  179.    to decide how they should behave.  Specifically, they decide (based
  180.    upon the value of `_lib_version') if they will act in a strictly ANSI
  181.    conforming manner or not.
  182. */
  183.  
  184. #undef    STARTFILE_SPEC
  185. #define STARTFILE_SPEC "%{!shared: \
  186.              %{!symbolic: \
  187.               %{pg:gcrt1.o%s}%{!pg:%{p:mcrt1.o%s}%{!p:crt1.o%s}} \
  188.               %{pg:gcrti.o%s}%{!pg:crti.o%s} \
  189.               %{ansi:values-Xc.o%s} \
  190.               %{!ansi: \
  191.                %{traditional:values-Xt.o%s} \
  192.                %{!traditional:values-Xa.o%s}}}} crtbegin.o%s"
  193.  
  194. /* Attach a special .ident directive to the end of the file to identify
  195.    the version of GCC which compiled this code.  The format of the
  196.    .ident string is patterned after the ones produced by native svr4
  197.    C compilers.  */
  198.  
  199. #define IDENT_ASM_OP ".ident"
  200.  
  201. #define ASM_FILE_END(FILE)