configure.texi
来自「基于4个mips核的noc设计」· TEXI 代码 · 共 1,744 行 · 第 1/5 页
TEXI
1,744 行
\input texinfo@c %**start of header@setfilename configure.info@settitle The GNU configure and build system@setchapternewpage off@c %**end of header@dircategory GNU admin@direntry* configure: (configure). The GNU configure and build system@end direntry@ifinfoThis file documents the GNU configure and build system.Copyright (C) 1998 Cygnus Solutions.Permission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.@ignorePermission is granted to process this file through TeX and print theresults, provided the printed document carries copying permissionnotice identical to this one except for the removal of this paragraph@end ignorePermission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translation approvedby the Foundation.@end ifinfo@titlepage@title The GNU configure and build system@author Ian Lance Taylor@page@vskip 0pt plus 1filllCopyright @copyright{} 1998 Cygnus SolutionsPermission is granted to make and distribute verbatim copies ofthis manual provided the copyright notice and this permission noticeare preserved on all copies.Permission is granted to copy and distribute modified versions of thismanual under the conditions for verbatim copying, provided that the entireresulting derived work is distributed under the terms of a permissionnotice identical to this one.Permission is granted to copy and distribute translations of this manualinto another language, under the above conditions for modified versions,except that this permission notice may be stated in a translationapproved by the Free Software Foundation.@end titlepage@ifinfo@node Top@top GNU configure and build systemThe GNU configure and build system.@menu* Introduction:: Introduction.* Getting Started:: Getting Started.* Files:: Files.* Configuration Names:: Configuration Names.* Cross Compilation Tools:: Cross Compilation Tools.* Canadian Cross:: Canadian Cross.* Cygnus Configure:: Cygnus Configure.* Multilibs:: Multilibs.* FAQ:: Frequently Asked Questions.* Index:: Index.@end menu@end ifinfo@node Introduction@chapter IntroductionThis document describes the GNU configure and build systems. Itdescribes how autoconf, automake, libtool, and make fit together. Italso includes a discussion of the older Cygnus configure system.This document does not describe in detail how to use each of the tools;see the respective manuals for that. Instead, it describes which filesthe developer must write, which files are machine generated and how theyare generated, and where certain common problems should be addressed.@ifnothtmlThis document draws on several sources, including the autoconf manual byDavid MacKenzie (@pxref{Top, , autoconf overview, autoconf, Autoconf}),the automake manual by David MacKenzie and Tom Tromey (@pxref{Top, ,automake overview, automake, GNU Automake}), the libtool manual byGordon Matzigkeit (@pxref{Top, , libtool overview, libtool, GNUlibtool}), and the Cygnus configure manual by K. Richard Pixley.@end ifnothtml@ifhtmlThis document draws on several sources, including@uref{http://www.delorie.com/gnu/docs/autoconf/autoconf_toc.html, theautoconf manual} by David MacKenzie,@uref{http://www.delorie.com/gnu/docs/automake/automake_toc.html, theautomake manual} by David MacKenzie and Tom Tromey,@uref{http://www.delorie.com/gnu/docs/libtool/libtool_toc.html, thelibtool manual} by Gordon Matzigkeit, and the Cygnus configure manual byK. Richard Pixley.@end ifhtml@menu* Goals:: Goals.* Tools:: The tools.* History:: History.* Building:: Building.@end menu@node Goals@section Goals@cindex goalsThe GNU configure and build system has two main goals.The first is to simplify the development of portable programs. Thesystem permits the developer to concentrate on writing the program,simplifying many details of portability across Unix and even Windowssystems, and permitting the developer to describe how to build theprogram using simple rules rather than complex Makefiles.The second is to simplify the building of programs distributed as sourcecode. All programs are built using a simple, standardized, two stepprocess. The program builder need not install any special tools inorder to build the program.@node Tools@section ToolsThe GNU configure and build system is comprised of several differenttools. Program developers must build and install all of these tools.People who just want to build programs from distributed sources normallydo not need any special tools beyond a Unix shell, a make program, and aC compiler.@table @asis@item autoconfprovides a general portability framework, based on testing the featuresof the host system at build time.@item automakea system for describing how to build a program, permitting the developerto write a simplified @file{Makefile}.@item libtoola standardized approach to building shared libraries.@item gettextprovides a framework for translation of text messages into otherlanguages; not really discussed in this document.@item m4autoconf requires the GNU version of m4; the standard Unix m4 does notsuffice.@item perlautomake requires perl.@end table@node History@section History@cindex historyThis is a very brief and probably inaccurate history.As the number of Unix variants increased during the 1980s, it becameharder to write programs which could run on all variants. While it wasoften possible to use @code{#ifdef} to identify particular systems,developers frequently did not have access to every system, and thecharacteristics of some systems changed from version to version.By 1992, at least three different approaches had been developed:@itemize @bullet@itemThe Metaconfig program, by Larry Wall, Harlan Stenn, and RaphaelManfredi.@itemThe Cygnus configure script, by K. Richard Pixley, and the gcc configurescript, by Richard Stallman. These use essentially the same approach,and the developers communicated regularly.@itemThe autoconf program, by David MacKenzie.@end itemizeThe Metaconfig program is still used for Perl and a few other programs.It is part of the Dist package. I do not know if it is being developed.In 1994, David MacKenzie and others modified autoconf to incorporate allthe features of Cygnus configure. Since then, there has been a slow butsteady conversion of GNU programs from Cygnus configure to autoconf. gcchas been converted, eliminating the gcc configure script.GNU autoconf was regularly maintained until late 1996. As of thiswriting in June, 1998, it has no public maintainer.Most programs are built using the make program, which requires thedeveloper to write Makefiles describing how to build the programs.Since most programs are built in pretty much the same way, this led to alot of duplication.The X Window system is built using the imake tool, which uses a databaseof rules to eliminate the duplication. However, building a tool whichwas developed using imake requires that the builder have imakeinstalled, violating one of the goals of the GNU system.The new BSD make provides a standard library of Makefile fragments,which permits developers to write very simple Makefiles. However, thisrequires that the builder install the new BSD make program.In 1994, David MacKenzie wrote the first version of automake, whichpermitted writing a simple build description which was converted into aMakefile which could be used by the standard make program. In 1995, TomTromey completely rewrote automake in Perl, and he continues to enhanceit.Various free packages built libraries, and by around 1995 severalincluded support to build shared libraries on various platforms.However, there was no consistent approach. In early 1996, GordonMatzigkeit began working on libtool, which provided a standardizedapproach to building shared libraries. This was integrated intoautomake from the start.The development of automake and libtool was driven by the GNITS project,a group of GNU maintainers who designed standardized tools to help meetthe GNU coding standards.@node Building@section BuildingMost readers of this document should already know how to build a tool byrunning @samp{configure} and @samp{make}. This section may serve as aquick introduction or reminder.Building a tool is normally as simple as running @samp{configure}followed by @samp{make}. You should normally run @samp{configure} froman empty directory, using some path to refer to the @samp{configure}script in the source directory. The directory in which you run@samp{configure} is called the @dfn{object directory}.In order to use a object directory which is different from the sourcedirectory, you must be using the GNU version of @samp{make}, which hasthe required @samp{VPATH} support. Despite this restriction, using adifferent object directory is highly recommended:@itemize @bullet@itemIt keeps the files generated during the build from cluttering up yoursources.@item It permits you to remove the built files by simply removing the entirebuild directory.@itemIt permits you to build from the same sources with several sets ofconfigure options simultaneously.@end itemizeIf you don't have GNU @samp{make}, you will have to run @samp{configure}in the source directory. All GNU packages should support this; inparticular, GNU packages should not assume the presence of GNU@samp{make}.After running @samp{configure}, you can build the tools by running@samp{make}.To install the tools, run @samp{make install}. Installing the toolswill copy the programs and any required support files to the@dfn{installation directory}. The location of the installationdirectory is controlled by @samp{configure} options, as described below.In the Cygnus tree at present, the info files are built and installed asa separate step. To build them, run @samp{make info}. To install them,run @samp{make install-info}.All @samp{configure} scripts support a wide variety of options. Themost interesting ones are @samp{--with} and @samp{--enable} optionswhich are generally specific to particular tools. You can usually usethe @samp{--help} option to get a list of interesting options for aparticular configure script.The only generic options you are likely to use are the @samp{--prefix}and @samp{--exec-prefix} options. These options are used to specify theinstallation directory.The directory named by the @samp{--prefix} option will hold machineindependent files such as info files.The directory named by the @samp{--exec-prefix} option, which isnormally a subdirectory of the @samp{--prefix} directory, will holdmachine dependent files such as executables.The default for @samp{--prefix} is @file{/usr/local}. The default for@samp{--exec-prefix} is the value used for @samp{--prefix}.The convention used in Cygnus releases is to use a @samp{--prefix}option of @file{/usr/cygnus/@var{release}}, where @var{release} is thename of the release, and to use a @samp{--exec-prefix} option of@file{/usr/cygnus/@var{release}/H-@var{host}}, where @var{host} is theconfiguration name of the host system (@pxref{Configuration Names}).Do not use either the source or the object directory as the installationdirectory. That will just lead to confusion.@node Getting Started@chapter Getting StartedTo start using the GNU configure and build system with your softwarepackage, you must write three files, and you must run some tools tomanually generate additional files.@menu* Write configure.in:: Write configure.in.* Write Makefile.am:: Write Makefile.am.* Write acconfig.h:: Write acconfig.h.* Generate files:: Generate files.* Getting Started Example:: Example.@end menu@node Write configure.in@section Write configure.in@cindex @file{configure.in}, writingYou must first write the file @file{configure.in}. This is an autoconfinput file, and the autoconf manual describes in detail what this fileshould look like.You will write tests in your @file{configure.in} file to check forconditions that may change from one system to another, such as thepresence of particular header files or functions.For example, not all systems support the @samp{gettimeofday} function.If you want to use the @samp{gettimeofday} function when it isavailable, and to use some other function when it is not, you wouldcheck for this by putting @samp{AC_CHECK_FUNCS(gettimeofday)} in@file{configure.in}.When the configure script is run at build time, this will arrange todefine the preprocessor macro @samp{HAVE_GETTIMEOFDAY} to the value 1 ifthe @samp{gettimeofday} function is available, and to not define themacro at all if the function is not available. Your code can then use@samp{#ifdef} to test whether it is safe to call @samp{gettimeofday}.If you have an existing body of code, the @samp{autoscan} program may
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?