*183Ur &Rpslohu 7Rrov
Total Page:16
File Type:pdf, Size:1020Kb
*183UR &RPSLOHU 7RROV coX `H H|r6Hr YHUVLRQU Frontispiece Copyright © 1991-1999 Free Software Foundation Copyright © 1991-1999 Cygnus®. All rights reserved. GNUPro®, the GNUPro logo, the Cygnus logo, Cygnus Insight™, Cygwin™, eCos™ and Source-Navigator™ are all trademarks of Cygnus. All other brand and product names, trademarks and copyrights are the property of their respective owners. Permission is granted to make and distribute verbatim copies of this documentation, provided the copyright notice and this permission notice are preserved on all copies. Permission is granted to copy and distribute modified versions of this documentation under the conditions for verbatim copying, provided also that the entire resulting derived work is distributed under the terms of a permission notice identical to this one. Permission is granted to copy and distribute translations of this documentation into another language, under the above conditions for modified versions. This documentation has been prepared by Cygnus Technical Publications; contact the Cygnus Technical Publications staff: [email protected]. While every precaution has been taken in the preparation of this documentation, the publisher assumes no responsibility for errors or omissions, or for damages resulting from the use of the information within the documentation. For licenses and use information, see “GNU General Public License” on page 16, “Source-Navigator source code comprehension tool license” on page 21, “Tcl/Tk tool command language and windowing toolkit license” on page 24 and “General licenses and terms for using GNUPro Toolkit” on page 13 in GETTING STARTED. Part #: 300-400-10100042-99r1 ii ■ GNUPro Compiler Tools CYGNUS Frontispiece r©##o« The GNUPro Toolkit is free software, covered by the GNU General Public License, and you are welcome to change it and/or distribute copies of it under certain conditions. This version of GNUPro Toolkit is supported for customers of Cygnus. For non-customers, GNUPro Toolkit software has NO WARRANTY. Because this software is licensed free of charge, there are no warranties for it, to the extent permitted by applicable law. Except when otherwise stated in writing, the copyright holders and/or other parties provide the software “as is” without warranty of any kind, either expressed or implied, including, but not limited to, the implied warranties of merchantability and fitness for a particular purpose. The entire risk as to the quality and performance of the software is with you. Should the software prove defective, you assume the cost of all necessary servicing, repair or correction. In no event, unless required by applicable law or agreed to in writing, will any copyright holder, or any other party who may modify and/or redistribute the program as permitted above, be liable to you for damages, including any general, special, incidental or consequential damages arising out of the use or inability to use the program (including but not limited to loss of data or data being rendered inaccurate or losses sustained by you or third parties or a failure of the program to operate with any other programs), even if such holder or other party has been advised of the possibility of such damages. CYGNUS GNUPro Compiler Tools ■ iii Frontispiece !H#¤®®®6rj|fc#o6H This and all subsequent releases of the GNUPro Toolkit products are Year 2000 Compliant. For more information regarding Cygnus development and Y2K issues, see: http://www.cygnus.com/y2k.html Cygnus Solutions defines a product to be Year 2000 Compliant (Y2K) if it does not produce errors in recording, storing, processing and presenting calendar dates as a result of the transition from December 31, 1999 to January 1, 2000. A Y2K product will recognize the Year 2000 as a leap year. This compliance is contingent upon third party products that exchange date data with the Cygnus product doing so properly and accurately, in a form and format compatible with the Cygnus product. GNUPro Toolkit processes dates only to the extent of using the date data provided by the host or target operating system for date representation used in internal processes, such as file modifications. Any Y2K issues resulting from the operation of the Cygnus products, therefore, are necessarily dependent upon the Y2K compliance of relevant host and/or target operating systems. Cygnus has not tested all operating systems and, as such, cannot assure that every system and/or environment will manage and manipulate data involving dates before and after December 31, 1999, without any time or date related system defects or abnormalities, and without any decreases in functionality or performance. Cygnus cannot assure that applications which you modify using Cygnus products will be Year 2000 compliant. iv ■ GNUPro Compiler Tools CYGNUS Frontispiece r©r6ro#6«Xo¦ Use the following means to contact Cygnus. Cygnus Headquarters 1325 Chesapeake Terrace Sunnyvale, CA 94089 USA Telephone (toll free): +1 800 CYGNUS-1 Telephone (main line): +1 408 542 9600 FAX: +1-408 542 9699 (Faxes are answered 8 a.m.–5 p.m., Monday through Friday.) email: [email protected] Website: www.cygnus.com/ Cygnus United Kingdom 36 Cambridge Place Cambridge CB2 1NS United Kingdom Telephone: +44 1223 728728 FAX: +44 1223 728728 email: [email protected]/ Website: http://sourceware.cygnus.com/ecos/ Cygnus Japan Nihon Cygnus Solutions Madre Matsuda Building 4-13 Kioi-cho Chiyoda-ku Tokyo 102-0094 Telephone: +81 3 3234 3896 FAX: +81 3 3239 3300 email: [email protected] Website: http://www.cygnus.co.jp/ The most reliable and most expedient means to resolve problems with GNUPro Toolkit is by using the Cygnus Web Support site: http://support.cygnus.com CYGNUS GNUPro Compiler Tools ■ v Frontispiece vi ■ GNUPro Compiler Tools CYGNUS GNUPro Compiler Tools roHo GNUPro warranty ........................................................................................................iii Year 2000 compliance ..............................................................................................iv How to contact Cygnus .................................................................................................v coX GNU General Public License.....................................................................................................3 Preamble........................................................................................................................3 Terms and conditions for copying, distribution and modification................................4 How to apply these terms to your new programs..........................................................9 Contributors to GNU CC..........................................................................................................11 Funding free software...............................................................................................................15 Protect your freedom; fight “Look and Feel”...........................................................................17 Introduction to the compiler for C, C++, or Objective C .............................................21 Installing GCC...............................................................................................................23 Installing GCC on UNIX systems...............................................................................24 Configurations supported by GCC..............................................................................34 Compilation in a separate directory ............................................................................48 Building and installing a cross-compiler.....................................................................49 Steps of cross-compilation..........................................................................................49 CYGNUS GNUPro Compiler Tools ■ vii Configuring a cross-compiler......................................................................................50 Tools and libraries for a cross-compiler......................................................................50 libgcc.a and cross-compilers....................................................................................51 Cross-compilers and header files ................................................................................53 Standard header file directories...................................................................................54 Actually building the cross-compiler..........................................................................54 collect2 and cross-compiling ...................................................................................55 Installing GCC on the Sun ..........................................................................................56 Installing GCC on VMS..............................................................................................57 Using GCC on VMS.................................................................................................60 GNU CC command options...........................................................................................67 Option summary for GCC...........................................................................................69 Overall options ........................................................................................................69 C language options ..................................................................................................69 C++ language options.............................................................................................69