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 / gcc.hlp < prev    next >
Text File  |  1994-02-06  |  14KB  |  407 lines

  1. 1 GCC
  2.  
  3.  The GCC command invokes the GNU C compiler.
  4.  
  5.        GCC file-spec
  6.  
  7. 2 Parameters
  8.  
  9.  file-spec
  10.  
  11.  A C source file.  If no input file  extension  is  specified,  GNU  C
  12.  assumes  .C  as  the  default extension unless the /PLUS qualifier is
  13.  given, in which case .CC is assumed as the default extension.
  14.  
  15.  If an extension of .CPP is given, then the source file is assumed  to
  16.  be  the  output of the preprocessor, and thus the preprocessor is not
  17.  executed.
  18.  
  19.  If an extension of .S is given, then the source file is assumed to be
  20.  the  assembly  code output of the compiler, and only the assembler is
  21.  called to generate an object file.
  22.  
  23. 2 Qualifiers
  24.  
  25.  GNU C command qualifiers modify the  way  the  compiler  handles  the
  26.  compilation.
  27.  
  28.  The following is the list of available qualifiers for GNU C:
  29.  
  30.        /CASE_HACK
  31.        /CC1_OPTIONS=(option [,option...]])
  32.        /DEBUG
  33.        /DEFINE=(identifier[=definition][,...])
  34.        /G_FLOAT
  35.        /INCLUDE_DIRECTORY=(path [,path...]])
  36.        /LIST[=filename]
  37.        /MACHINE_CODE
  38.        /OBJECT[=filename]
  39.        /OPTIMIZE
  40.        /PLUS
  41.        /PROFILE[=identifier]
  42.        /SCAN=(file[,file...])
  43.        /SHOW[=option]
  44.        /UNDEFINE=(identifier[,identifier,...])
  45.        /VERBOSE
  46.        /VERSION
  47.        /WARNING
  48.  
  49. 2 Linking
  50.  
  51.  When linking programs compiled with GNU C, you should include the GNU
  52.  C library before the VAX C library.  For example,
  53.  
  54.    LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTL/LIB
  55.  
  56.  You can also link your program with the shared VAX C  library.   This
  57.  can reduce the size of the .EXE file, as well as make it smaller when
  58.  it's running.  For example,
  59.  
  60.    $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT/OPT
  61.    SYS$SHARE:VAXCRTL/SHARE
  62.  
  63.  (If you use the second example and type it in by  hand,  be  sure  to
  64.  type ^Z after the last carriage return).  A simpler alternative would
  65.  be to place the single line:
  66.  
  67.    SYS$SHARE:VAXCRTL/SHARE
  68.  
  69.  into a file called VAXCRTL.OPT, and then use the link command:
  70.  
  71.    $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,VAXCRTL.OPT/OPT
  72.  
  73.  If a program has  been  compiled  with  /G_FLOAT,  then  the  linking
  74.  instructions  are  slightly  different.   If you are linking with the
  75.  non-shared library, then the command that you should use would be:
  76.  
  77.    LINK object-file,GNU_CC:[000000]GCCLIB/LIB,SYS$LIBRARY:VAXCRTLG/LIB -
  78.                                 ,SYS$LIBRARY:VAXCRTL/LIB
  79.  
  80.  Note that both VAXCRTL and VAXCRTLG must be linked to.   If  you  are
  81.  using the shared VAX C library, then you should use a command like:
  82.  
  83.    $ LINK object-file, GNU_CC:[000000]GCCLIB/LIB,SYS$INPUT:/OPTIONS
  84.    SYS$SHARE:VAXCRTLG/SHARE
  85.  
  86.  In the case of the sharable library, only one  library  needs  to  be
  87.  linked to.
  88.  
  89.  If you need to link to libg++, it  is  easiest  to  use  the  command
  90.  procedure supplied with libg++ to link your program.
  91.  
  92. 2 /CASE_HACK
  93.  
  94.    /[NO]CASE_HACK      D=/CASE_HACK
  95.  
  96.  Since the VMS Linker  and  Librarian  are  not  case  sensitive  with
  97.  respect  to  symbol names, a "case-hack" is appended to a symbol name
  98.  when the symbol contains upper case characters.
  99.  
  100.  There are cases where this is undesirable, (mainly when using certain
  101.  applications  where modules have been precompiled, perhaps in another
  102.  language) and we want to compile  without  case  hacking.   In  these
  103.  cases the /NOCASE_HACK switch disables case hacking.
  104.  
  105. 2 /CC1_OPTIONS
  106.  
  107.  This specifies additional  switches  to  the  compiler  itself  which
  108.  cannot be set by means of the compiler driver.
  109.  
  110. 2 /DEBUG
  111.  
  112.  /DEBUG includes additional information in the object file  output  so
  113.  that the program can be debugged with the VAX Symbolic Debugger.
  114.  
  115.  To use the debugger it is also necessary to link the debugger to your
  116.  program, which is done by specifying the /DEBUG qualifier to the link
  117.  command.  With the  debugger  it  is  possible  to  set  breakpoints,
  118.  examine  variables,  and  set  variables  to new values.  See the VAX
  119.  Symbolic Debugger manual for more information, or  type  "HELP"  from
  120.  the debugger prompt.
  121.  
  122. 2 /DEFINE
  123.  
  124.  /DEFINE=(identifier[=definition][,...])
  125.  
  126.  /DEFINE defines a string or macro ('definition')  to  be  substituted
  127.  for  every  occurrence of a given string ('identifier') in a program.
  128.  It is equivalent to the #define preprocessor directive.
  129.  
  130.  All definitions and identifiers are  converted  to  uppercase  unless
  131.  they are in quotation marks.
  132.  
  133.  The simple form of the /DEFINE qualifier:
  134.  
  135.     /DEFINE=vms
  136.  
  137.  results in a definition equivalent to the preprocessor directive:
  138.  
  139.   #define VMS 1
  140.  
  141.  You must enclose macro definitions in quotation  marks,  as  in  this
  142.  example:
  143.  
  144.   /DEFINE="C(x)=((x) & 0xff)"
  145.  
  146.  This definition is the same as the preprocessor definition:
  147.  
  148.   #define C(x) ((x) & 0xff)
  149.  
  150.  If more than one /DEFINE is present on the GCC command line, only the
  151.  last /DEFINE is used.
  152.  
  153.  If both /DEFINE and /UNDEFINE are present on a command line,  /DEFINE
  154.  is evaluated before /UNDEFINE.
  155.  
  156. 2 /G_FLOAT
  157.  
  158.  Instructs the compiler to use "G" floating point  arithmetic  instead
  159.  of  "D".   The  difference  is  that  double precision has a range of
  160.  approximately +/-0.56e-308 to +/-0.9  e+308,  with  approximately  15
  161.  decimal digits precision.
  162.  
  163.  "D" floating point has the same range as  single  precision  floating
  164.  point, with approximately 17 decimal digits precision.
  165.  
  166.  If you use the  /G_FLOAT  qualifier,  the  linking  instructions  are
  167.  different.  See "Linking" for further details.
  168.  
  169. 2 /LIST
  170.  
  171.  /LIST[=list_file_name]
  172.  
  173.  This does not generate a listing file in the usual sense, however  it
  174.  does  direct the compiler to save the preprocessor output.  If a file
  175.  is not specified, then this output is written into a  file  with  the
  176.  same name as the source file and an extension of .CPP.
  177.  
  178. 2 /INCLUDE_DIRECTORY
  179.  
  180.   /INCLUDE_DIRECTORY=(path [,path...])
  181.  
  182.  The /INCLUDE_DIRECTORY qualifier provides additional  directories  to
  183.  search  for  user-defined  include  files.   'path'  can  be either a
  184.  logical name or a directory specification.
  185.  
  186.  There  are  two  forms  for  specifying  include  files  -   #include
  187.  "file-spec"  and  #include <file-spec>.  For the #include "file-spec"
  188.  form, the search order is:
  189.  
  190.   1.  The directory containing the source file.
  191.  
  192.   2.  The directories in the /INCLUDE qualifier (if any).
  193.  
  194.   3.  The directory (or directories) specified in the logical name
  195.       GNU_CC_INCLUDE.
  196.  
  197.   4.  The directory (or directories) specified in the logical name
  198.       SYS$LIBRARY.
  199.  
  200.   For the #include <file-spec> form, the search order is:
  201.  
  202.   1.  The directories specified in the /INCLUDE qualifier (if any).
  203.  
  204.   2.  The directory (or directories) specified in the logical name
  205.       GNU_CC_INCLUDE.
  206.  
  207.   3.  The directory (or directories) specified in the logical name
  208.       SYS$LIBRARY.
  209.  
  210. 2 /MACHINE_CODE
  211.  
  212.  Tells GNU C to output the machine code  generated  by  the  compiler.
  213.  The  machine code is output to a file with the same name as the input
  214.  file, with the extension .S.  An  object  file  is  still  generated,
  215.  unless /NOOBJ is also specified.
  216.  
  217. 2 /OBJECT
  218.  
  219.    /OBJECT[=filename]
  220.    /NOOBJECT
  221.  
  222.         Controls whether or not an object file  is  generated  by  the
  223.  compiler.
  224.  
  225. 2 /OPTIMIZE
  226.  
  227.  /[NO]OPTIMIZE
  228.  
  229.  Controls whether optimization  is  performed  by  the  compiler.   By
  230.  default, optimization is on.  /NOOPTIMIZE turns optimization off.
  231.  
  232. 2 /PLUS
  233.  
  234.  Instructs the compiler driver to use the GNU-C++ compiler instead  of
  235.  the  GNU-C compiler.  Note that the default extension of source files
  236.  is .CC when this qualifier is in effect.
  237.  
  238. 2 /PROFILE
  239.  
  240.  /PROFILE[=identifier]
  241.  
  242.  Instructs the compiler to generate function profiling code.  You must
  243.  link  your  program  to  the profiler when you use this options.  The
  244.  profile statistics are automatically  printed  out  on  the  terminal
  245.  during  image  exit.  (i.e.  no modifications to your source file are
  246.  required in order to use the profiler).
  247.  
  248.  There are three identifiers  that  can  be  used  with  the  /PROFILE
  249.  switch.   These  are  ALL, FUNCTION, and BLOCK.  If /PROFILE is given
  250.  without an identifier, then FUNCTION is assumed.
  251.  
  252. 3 Block_Profiler
  253.  
  254.  The block profiler counts how  many  times  control  of  the  program
  255.  passes certain points in your program.  This