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 / README.X11 < prev    next >
Text File  |  1994-02-06  |  6KB  |  204 lines

  1. How to compile X11R5 (patch level 11) with GCC version 2:
  2.  
  3. The patches include support for building the shared libraries with GCC 2 on 
  4. the Sparc and 68k machines.  NOTE: Such shared libraries DO NOT WORK
  5. with executables previously linked using Sun CC!  This is because
  6. neither those executables nor the gcc-compiled shared libraries contain
  7. libgcc.a.  The shared libraries do work with executables linked using
  8. GCC (running the Sun linker, of course) because GCC tells the linker to
  9. link in libgcc.a.  Because of these limitations the default behavior is
  10. to NOT build the shared libraries with gcc.  If you want the gcc-compiled
  11. shared libraries turn on "Gcc2BuildLibs" in site.def
  12.  
  13. If you want to build a shared library that works with executables
  14. linked with Sun CC, you will have to arrange to include libgcc.a in
  15. the shared libraries.  The instructions below do not handle this.
  16.  
  17. Sun forgot to include a static version of libdl.a with some versions
  18. of SunOS (4.1 mainly).  If you see undefined symbols _dlopen, _dlsym,
  19. or _dlclose when linking with -lX11, compile and link against the file
  20. mit/util/misc/dlsym.c in the MIT X11R5 distribution.
  21.  
  22. mit/config/Imake.tmpl -- Do not set -fstrength-reduce if we have GCC 2.  If
  23. -fstrength-reduce (or any other -f option) is a major win, then it will
  24. most likely be turned on by -O2 optimization.
  25.  
  26. mit/config/sunLib.rules -- If HasGcc2 and Gcc2BuildLibs are defined, then 
  27. use gcc -fpic to generate PIC code.  Make sure that gcc does not use gas (the 
  28. GNU assembler) when compiling PIC code; gas does not assemble it correctly.  
  29. If you have gas installed where gcc uses it by default, you might have to add
  30. -B/bin/ to the PositionIndependentCFlags.
  31.  
  32. mit/config/site.def -- Define HasGcc2 to be YES.
  33.  
  34. mit/config/sun.cf -- When compiling with GCC 2, use -O2 optimization.
  35.  
  36. mit/rgb/Imakefile -- No longer need to compile some modules with 
  37. cc on the Sparc since GCC 2 produces proper -fpcc-struct-return code.
  38.  
  39. mit/server/os/Imakefile -- Likewise.
  40.  
  41. mit/clients/twm/Imakefile -- fix bad decls of malloc, realloc in gram.c.
  42.  
  43. *** mit/config/Imake.tmpl.ORIG    Tue Dec 31 11:07:56 1991
  44. --- mit/config/Imake.tmpl    Tue Dec 31 12:30:47 1991
  45. ***************
  46. *** 499,508 ****
  47. --- 499,512 ----
  48.   #define HasGcc NO
  49.   #endif
  50.   #ifndef CcCmd
  51. + #if HasGcc2
  52. + #define CcCmd gcc -fpcc-struct-return
  53. + #else
  54.   #if HasGcc
  55.   #define CcCmd gcc -fstrength-reduce -fpcc-struct-return 
  56.   #else
  57.   #define CcCmd cc
  58. + #endif
  59.   #endif
  60.   #endif
  61.   #if HasFortran
  62. *** mit/config/sunLib.rules.ORIG    Tue Dec 31 11:11:24 1991
  63. --- mit/config/sunLib.rules    Tue May  5 12:26:12 1992
  64. ***************
  65. *** 23,30 ****
  66. --- 23,34 ----
  67.   #define SharedLibraryLoadFlags -assert pure-text
  68.   #endif
  69.   #ifndef PositionIndependentCFlags
  70. + #if defined(HasGcc2) && defined (Gcc2BuildLibs)
  71. + #define PositionIndependentCFlags -fpic
  72. + #else
  73.   #define PositionIndependentCFlags -pic
  74.   #endif
  75. + #endif
  76.   
  77.   /*
  78.    * InstallSharedLibrary - generate rules to install the shared library.
  79. *** mit/config/site.def.ORIG    Tue Dec 31 11:13:49 1991
  80. --- mit/config/site.def    Tue Dec 31 12:02:59 1991
  81. ***************
  82. *** 25,31 ****
  83.   
  84.   #ifdef BeforeVendorCF
  85.   
  86. ! /* #define HasGcc YES */
  87.   
  88.   #endif /* BeforeVendorCF */
  89.   
  90. --- 25,33 ----
  91.   
  92.   #ifdef BeforeVendorCF
  93.   
  94. ! #define HasGcc YES 
  95. ! #define HasGcc2 YES
  96. ! /* #define Gcc2BuildLibs YES */
  97.   
  98.   #endif /* BeforeVendorCF */
  99.   
  100. *** mit/config/sun.cf.ORIG    Tue Dec 31 11:13:57 1991
  101. --- mit/config/sun.cf    Tue May  5 12:29:50 1992
  102. ***************
  103. *** 34,42 ****
  104. --- 41,61 ----
  105.   
  106.   #if HasGcc
  107.   
  108. + #if defined(HasGcc2) 
  109. + #define OptimizedCDebugFlags -O2 
  110. + /* Leave Alone XXX */
  111. + #else 
  112. + #define OptimizedCDebugFlags -O
  113.   #define SharedLibraryCcCmd cc
  114.   #define ExtraLoadFlags -B/usr/bin/
  115.   #define AllocateLocalDefines /**/
  116. + #endif
  117. + #if !defined(Gcc2BuildLibs)
  118. + #define SharedLibraryCcCmd cc
  119. + #define ExtraLoadFlags -B/usr/bin/
  120. + #define AllocateLocalDefines /**/
  121. + #endif
  122.   
  123.   .c.o:
  124.       $(CC) -c $(CFLAGS) $*.c
  125. *** mit/rgb/Imakefile.ORIG    Wed Jan 15 16:43:18 1992
  126. --- mit/rgb/Imakefile    Thu Jan  2 13:34:09 1992
  127. ***************
  128. *** 17,23 ****
  129.   #if !(defined(SGIArchitecture) || SystemV4)
  130.          DBMLIB = -ldbm
  131.   #endif
  132. ! #if defined(SparcArchitecture) && HasGcc
  133.              CC = cc
  134.       CCOPTIONS = /**/
  135.       EXTRA_LOAD_FLAGS = /**/
  136. --- 17,23 ----
  137.   #if !(defined(SGIArchitecture) || SystemV4)
  138.          DBMLIB = -ldbm
  139.   #endif
  140. ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
  141.              CC = cc
  142.       CCOPTIONS = /**/
  143.       EXTRA_LOAD_FLAGS = /**/
  144. *** mit/server/os/Imakefile.ORIG    Wed Jan 15 16:46:23 1992
  145. --- mit/server/os/Imakefile    Wed Jan 15 16:46:48 1992
  146. ***************
  147. *** 132,138 ****
  148.   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
  149.   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
  150.   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
  151. ! #if defined(SparcArchitecture) && HasGcc
  152.   oscolor.o: $(ICONFIGFILES)
  153.       $(RM) $@
  154.       cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
  155. --- 132,138 ----
  156.   SpecialObjectRule(osinit.o,$(ICONFIGFILES),$(ADM_DEFINES))
  157.   SpecialObjectRule(WaitFor.o,$(ICONFIGFILES),$(EXT_DEFINES))
  158.   SpecialObjectRule(fonttype.o,$(ICONFIGFILES),$(FONT_DEFINES))
  159. ! #if defined(SparcArchitecture) && HasGcc && !defined(HasGcc2)
  160.   oscolor.o: $(ICONFIGFILES)
  161.       $(RM) $@
  162.       cc -c $(DBM_DEFINES) $(CDEBUGFLAGS) $(ALLDEFINES) $*.c
  163. *** 1.1 1992/09/08 19:52:07
  164. --- mit/server/ddx/sun/Imakefile        1992/09/08 21:10:22
  165. ***************
  166. *** 43,48 ****
  167. --- 43,53 ----
  168.   LinkFile(sunGX.o,sunGX.o.dist)
  169.   #endif
  170.  
  171. + #if HasGcc2
  172. + SpecialObjectRule(sunCG2C.o,sunCG2C.c,-fvolatile)
  173. + SpecialObjectRule(sunCG2M.o,sunCG2M.c,-fvolatile)
  174. + #endif
  175.   sunInitExtMono.o: $(ICONFIGFILES)
  176.   ObjectFromSpecialSource(sunInitExtMono,../mi/miinitext,-UPEXEXT)
  177.   ObjectFromSpecialSource(sunInitMono,sunInit,-DMONO_ONLY)
  178.  
  179. *** /tmp/RCSAa24446     Tue Sep 15 12:23:32 1992
  180. --- mit/clients/twm/Imakefile   Thu Aug 13 18:18:07 1992
  181. ***************
  182. *** 32,41 ****
  183. --- 32,48 ----
  184.   ComplexProgramTarget(twm)
  185.   InstallNonExecFile(system.twmrc,$(TWMDIR))
  186.   
  187. + #if HasGcc2 && defined (SunArchitecture)
  188.   gram.h gram.c: gram.y
  189.         yacc $(YFLAGS) gram.y
  190. +       sed -e 's/^extern char \*malloc(), \*realloc();//g' y.tab.c >gram.c
  191. +       $(MV) y.tab.h gram.h
  192. + #else
  193. + gram.h gram.c: gram.y
  194. +       yacc $(YFLAGS) gram.y
  195.         $(MV) y.tab.c gram.c
  196.         $(MV) y.tab.h gram.h
  197. + #endif
  198.   
  199.   clean::
  200.         $(RM) y.tab.h y.tab.c lex.yy.c gram.h gram.c lex.c deftwmrc.c 
  201.  
  202.