home *** CD-ROM | disk | FTP | other *** search
/ Geek Gadgets 1 / ADE-1.bin / ade-dist / libg++-2.7.1-base.tgz / libg++-2.7.1-src.tar / fsf / libg++ / mpw-README < prev    next >
Text File  |  1995-10-27  |  8KB  |  208 lines

  1. This is preliminary information about the Macintosh(tm) MPW(tm) port
  2. of the Cygnus GNU tools.
  3.  
  4.  
  5. INSTALLING CYGNUS GNU TOOLS
  6.  
  7. To use these tools, you will need a Mac with a 68020 or better or else
  8. any PowerMac, System 7.1 or later, and MPW 3.3 or 3.4.  You will *not*
  9. need MPW C unless you want to rebuild from sources, nor even any
  10. include files, unless you are building actual Mac applications.
  11.  
  12. The Cygnus GNU tools can go in any directory that is in your
  13. {Commands} list.  We generally put all the tools in something like
  14. {Boot}Cygnus:latest:bin, and something like this in the UserStartup
  15. file:
  16.  
  17.     set Commands "{Boot}Cygnus:latest:bin:,{Commands}"
  18.  
  19. However, the cpp and cc1 programs of GCC are not normally stored here.
  20. Instead, they will be in a "lib" directory that is alongside "bin",
  21. and organized by target and version underneath, with names like
  22.  
  23.     :lib:gcc-lib:mips-idt-ecoff:cygnus-2.6.4-950305:
  24.  
  25. If you built and installed everything yourself according to the build
  26. instructions, then you will not have any problems.  However, you may
  27. discover that GCC seems unable to find the right cpp and cc1; usually
  28. this will be because directory names have changed.  (Even renaming
  29. your hard disk will make this happen.)  In such cases, you have
  30. several choices.  One is just to add this directory to {Commands}, but
  31. then you will not be able to get any other cpp or cc1, such as those
  32. used by a different target or version.  Another way is to rename your
  33. disk and directories to match the prefix used when the tools were
  34. compiled.  Finally, you can set the variable GCC_EXEC_PREFIX to point
  35. to the library directory:
  36.  
  37.     set GCC_EXEC_PREFIX MyDisk:Stuff:lib:gcc-lib:
  38.     export GCC_EXEC_PREFIX
  39.  
  40.  
  41. USING CYGNUS GNU TOOLS
  42.  
  43. To compile and link a file "foo.c", say
  44.  
  45.     gC foo.c
  46.  
  47. This port of GCC exactly the same option syntax as its Unix
  48. counterpart.  It also has similar compilation rules, so it will run
  49. the assembler on .s files and so forth.  For the example above, the
  50. output file will be an MPW binary file named "a.out".
  51.  
  52. The GCC manual includes full information on the available options.
  53. One option that may be especially useful is "-v", which shows you what
  54. tools and options are being used; unlike MPW C, GCC directs assembly
  55. and linking in addition to compilation.
  56.  
  57. The assembler ("as") and linker ("ld") are faithful ports of their
  58. Unix counterparts.  Similarly, the binutils "ar", "cplusfilt", "nm",
  59. "objcopy", "objdump", "ranlib", "size", "strings", and "strip" are all
  60. like they are under Unix.  (Note that "cplusfilt" is actually called
  61. "c++filt" under Unix.)
  62.  
  63. There are two flavors of GDB.  "gdb" is an MPW tool that works very
  64. much like it does in Unix; put a command into the MPW worksheet and
  65. type the <enter> key to send it to GDB.  While "gdb" is running, you
  66. cannot do anything else in MPW, although you can switch to other
  67. applications and use them.
  68.  
  69. "SiowGDB" is also a Mac application, but it is GDB using the SIOW
  70. package to provide console emulation.  Commands are exactly as for the
  71. MPW tool, but since this is its own application, you can switch
  72. between it and MPW.
  73.  
  74. Currently, both flavors of GDB can only do cross-debugging, via the
  75. serial port.
  76.  
  77.  
  78. BUILDING CYGNUS GNU TOOLS
  79.  
  80. This port of the Cygnus GNU tools uses a configure script similar to
  81. that used for GNU tools under Unix, but rewritten for MPW.  As with
  82. Unix configuration, there is an "object" directory that may be
  83. different from the "source" directory.  In the example commands below,
  84. we will assume that we are currently in the object directory, and that
  85. the source directory is "{Boot}Cygnus:src".
  86.  
  87. In addition to the sources, you will need a set of tools that the
  88. configure and build scripts assume to be available.  These tools
  89. (and their versions, if relevant) are as follows:
  90.  
  91.     byacc tool
  92.     flex (2.3.7) tool
  93.     forward-include script
  94.     MoveIfChange script
  95.     open-brace script
  96.     sed (1.13) tool
  97.     tr-7to8 script
  98.  
  99. The scripts are in the sources, under utils:mpw:, while you must
  100. arrange to get the other tools yourself (they are readily available
  101. from the "usual" net sites, and are also on many CDROMS).
  102.  
  103.     set Commands "{Boot}Cygnus:buildtools:,{Commands}"
  104.  
  105.     Set FLEX_SKELETON "{Boot}"Cygnus:buildtools:Flex.skel
  106.     Export FLEX_SKELETON
  107.  
  108. To build everything, setdirectory to the object directory and do:
  109.  
  110.     {Boot}Cygnus:src:mpw-configure --target <name> --cc <compiler> --srcdir {Boot}Cygnus:src: --prefix <whatever>
  111.  
  112. If the the source directory is not in your {Commands} list, then you must
  113. supply a full pathname to mpw-configure, since mpw-configure invokes
  114. itself after switching into each subdirectory.  Using a relative
  115. pathname, even something like ':mpw-configure', will therefore not work.
  116.  
  117. <name> must be a known target.  Valid ones include "m68k-apple-macos",
  118. "powerpc-apple-macos", "i386-unknown-go32", "mips-idt-ecoff", and
  119. "sh-hitachi-hms".  Not all target types are accepted for all of the
  120. tools yet.
  121.  
  122. <compiler> must be the name of the compiler to use.  It defaults to "mpwc".
  123.  
  124.     (m68k)
  125.     mpwc    MPW C
  126.     sc68k    Symantec C
  127.     mwc68k    Metrowerks C (Codewarrior)
  128.     gcc68k    GCC
  129.  
  130.     (powerpc)
  131.     ppcc    PPCC
  132.     mrc    Macintosh on RisC (Mister C, aka(?) Frankenstein)
  133.     scppc    Symantec C
  134.     mwcppc    Metrowerks C (Codewarrior)
  135.     gccppc    GCC
  136.  
  137. Not all compilers will compile all tools equally well!  For m68k Macs,
  138. MPW C has the best record so far (it has problems, but they can be
  139. worked around), while for PowerMacs, CodeWarrior is the only compiler
  140. that has successfully compiled everything into running code.
  141.  
  142. <prefix> is the path that "gcc" will prepend when looking for tools
  143. to execute.
  144.  
  145. Then the command
  146.  
  147.     mpw-build
  148.  
  149. will build everything, and
  150.  
  151.     mpw-build install
  152.  
  153. will install it.  Building will take over an hour on a Quadra 800.
  154.  
  155. Most versions of MPW C have problems with compiling GNU software.
  156.  
  157. MPW C 3.2.x has preprocessing bugs that render it incapable of
  158. compiling the BFD library, so it can't be used at all for building BFD.
  159.  
  160. MPW C 3.3, 3.3.1, and 3.3.2 will spontaneously claim to have found
  161. errors in the source code, but in fact the code is perfectly fine.  If
  162. this happens, just set the working directory back to the top-level
  163. objdir (where the configure command above was performed), and type
  164. "mpw-build all" again.  If it goes on through the supposed error, then
  165. you got one of the spurious errors.  A full build may require a number
  166. of these restarts.
  167.  
  168. MPW C 3.3.3 seems to work OK, at least with the aid of a number of
  169. workarounds that are in the sources (look for #ifdef MPW_C).
  170.  
  171. Versions of MPW Make earlier than 4.0d2 have exhibited bizarre behavior,
  172. failure to substitute variables and the like.
  173.  
  174. Metrowerks CW6 PPC linker (MWLinkPPC) seems to do bad things with memory
  175. if the "Modern Memory Manager" is turned on (in the Memory control panel),
  176. but works OK if it is turned off.
  177.  
  178. Metrowerks CW6 loses bigtime compiling opcodes:ppc-opc.c, which has
  179. some deeply nested macros.  (CW7 is OK.)  There is a way to patch the
  180. file, by substituting constant values.  If you need to do this,
  181. contact shebs@cygnus.com for details.
  182.  
  183. <Gestalt.h> is missing from {CIncludes} in the MPW version that comes
  184. with CW 7.
  185. KNOWN BUGS
  186.  
  187. '/' or ' ' embedded in any device, directory, or file name may or may not work.
  188.  
  189. objcopy -O srec foo.o makes random output filenames.
  190.  
  191. Mac-x-mips requires -mgas but Unix hosts don't.
  192.  
  193. GDB will frequently require a '/' on the front of a device name in order
  194. to recognize it as an absolute rather than a relative pathname.
  195.  
  196. GDB doesn't seem to use the printer port correctly, although it tries.
  197.  
  198. The cursor doesn't always spin as much as it should.  To get elaborate
  199. statistics and warnings about spin rates, add this to UserStartup:
  200.  
  201.     set MEASURE_SPIN all
  202.     export MEASURE_SPIN
  203.  
  204. This is not a bug, but - watch out for cr/nl translation!  For instance,
  205. if config/mpw-mh-mpw is not properly translated because it has been
  206. copied or updated separately, then everything will almost build, but
  207. you will get puzzling error messages from make or the compiler.
  208.