📄 autobook_85.html
字号:
<HTML><!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"><!-- Created on September, 12 2004 by texi2html 1.64 --><!-- Written by: Lionel Cons <Lionel.Cons@cern.ch> (original author) Karl Berry <karl@freefriends.org> Olaf Bachmann <obachman@mathematik.uni-kl.de> and many others.Maintained by: Olaf Bachmann <obachman@mathematik.uni-kl.de>Send bugs and suggestions to <texi2html@mathematik.uni-kl.de> --><HEAD><TITLE>Autoconf, Automake, and Libtool: Extra Configure Options</TITLE><META NAME="description" CONTENT="Autoconf, Automake, and Libtool: Extra Configure Options"><META NAME="keywords" CONTENT="Autoconf, Automake, and Libtool: Extra Configure Options"><META NAME="resource-type" CONTENT="document"><META NAME="distribution" CONTENT="global"><META NAME="Generator" CONTENT="texi2html 1.64"><script language="Javascript"><!-- // Check the browser version. function checkVersion() { if (navigator.appVersion.charAt(0)>=3) return true; if (navigator.appVersion.charAt(0)>=4) return true; else return false; } if (checkVersion()) { homeon = new Image(); homeon.src = "homeon.png"; homeoff = new Image(); homeoff.src = "home.png"; tocon = new Image(); tocon.src = "tocon.png"; tocoff = new Image(); tocoff.src = "toc.png"; indexon = new Image(); indexon.src = "indexon.png"; indexoff = new Image(); indexoff.src = "index.png"; helpon = new Image(); helpon.src = "helpon.png"; helpoff = new Image(); helpoff.src = "help.png"; backon = new Image(); backon.src = "backon.png"; backoff = new Image(); backoff.src = "back.png"; forwardon = new Image(); forwardon.src = "forwardon.png"; forwardoff = new Image(); forwardoff.src = "forward.png"; prevon = new Image(); prevon.src = "prevon.png"; prevoff = new Image(); prevoff.src = "prev.png"; nexton = new Image(); nexton.src = "nexton.png"; nextoff = new Image(); nextoff.src = "next.png"; upon = new Image(); upon.src = "upon.png"; upoff = new Image(); upoff.src = "up.png"; } function img_act(imgName) { if (checkVersion()) { imgOn = eval(imgName + "on.src"); document [imgName].src = imgOn; } } function img_inact(imgName) { if (checkVersion()) { imgOff = eval(imgName + "off.src"); document [imgName].src = imgOff; } }// --></SCRIPT></HEAD><BODY LANG="EN" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#6688AA" VLINK="#336688" ALINK="#808080"><A NAME="SEC85"></A><TABLE BORDER=0 CELLPADDING=0 CELLSPACING=10><TR VALIGN="TOP"><TD ALIGN="MIDDLE" WIDTH=50 BGCOLOR="#e6e6e6"><TABLE CELLPADDING=1 CELLSPACING=1 BORDER=0><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_84.html#SEC84" onMouseover="img_act('prev')" onMouseout="img_inact('prev')"><IMG SRC="prev.png" BORDER="0" ALT="Back: Integration with configure.in" ALIGN="MIDDLE" NAME="prev"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_86.html#SEC86" onMouseover="img_act('next')" onMouseout="img_inact('next')"><IMG SRC="next.png" BORDER="0" ALT="Forward: Extra Macros for Libtool" ALIGN="MIDDLE" NAME="next"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"> <TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_83.html#SEC83" onMouseover="img_act('back')" onMouseout="img_inact('back')"><IMG SRC="back.png" BORDER="0" ALT="FastBack: Using GNU Libtool" ALIGN="MIDDLE" NAME="back"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_84.html#SEC84" onMouseover="img_act('up')" onMouseout="img_inact('up')"><IMG SRC="up.png" BORDER="0" ALT="Up: Integration with configure.in" ALIGN="MIDDLE" NAME="up"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_87.html#SEC87" onMouseover="img_act('forward')" onMouseout="img_inact('forward')"><IMG SRC="forward.png" BORDER="0" ALT="FastForward: Integration with Makefile.am" ALIGN="MIDDLE" NAME="forward"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook.html#SEC_Top" onMouseover="img_act('home')" onMouseout="img_inact('home')"><IMG SRC="home.png" BORDER="0" ALT="Top: Autoconf, Automake, and Libtool" ALIGN="MIDDLE" NAME="home"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_toc.html#SEC_Contents" onMouseover="img_act('toc')" onMouseout="img_inact('toc')"><IMG SRC="toc.png" BORDER="0" ALT="Contents: Table of Contents" ALIGN="MIDDLE" NAME="toc"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_285.html#SEC285" onMouseover="img_act('index')" onMouseout="img_inact('index')"><IMG SRC="index.png" BORDER="0" ALT="Index: Index" ALIGN="MIDDLE" NAME="index"></A></TD></TR><TR VALIGN="TOP" ALIGN="LEFT"><TD VALIGN="MIDDLE" ALIGN="LEFT"><A HREF="autobook_abt.html#SEC_About" onMouseover="img_act('help')" onMouseout="img_inact('help')"><IMG SRC="help.png" BORDER="0" ALT="About: About this document" ALIGN="MIDDLE" NAME="help"></A></TD></TR></TABLE></TD><TD ALIGN="LEFT"><H3> 11.1.1 Extra Configure Options </H3><!--docid::SEC85::--><P>What follows is a list that describes the more commonly used optionsthat are automatically added to <CODE>configure</CODE>, by virtue of using<SAMP>`AC_PROG_LIBTOOL'</SAMP> in your <TT>`configure.in'</TT>. The Libtool Manualdistributed with Libtool releases always contains the most up to dateinformation about <CODE>libtool</CODE> options:</P><P><DL COMPACT><DT><SAMP>`--enable-shared'</SAMP><DD><DT><SAMP>`--enable-static'</SAMP><DD>More often invoked as <SAMP>`--disable-shared'</SAMP> or equivalently<SAMP>`--enable-shared=no'</SAMP> these switches determine whether<CODE>libtool</CODE> should build shared and/or static libraries in thispackage. If the installer is short of disk space, they might like tobuild entirely without static archives. To do this they would use:<P><TABLE width=100%><tr><td> </td><td class=example bgcolor=#6688aa><br><pre>$ ./configure --disable-static</pre></td></tr></table></P><P>Sometimes it is desirable to configure several related packages with thesame command line. From a scheduled build script or where subpackageswith their own <CODE>configure</CODE> scripts are present, for example.The <SAMP>`--enable-shared'</SAMP> and <SAMP>`--enable-static'</SAMP> switches alsoaccept a list of package names, causing the option to be applied topackages whose name is listed, and the opposite to be applied to thosenot listed.</P><P>By specifying:</P><P><TABLE width=100%><tr><td> </td><td class=example bgcolor=#6688aa><br><pre>$ ./configure --enable-static=libsnprintfv,autoopts</pre></td></tr></table></P><P><CODE>libtool</CODE> would pass <SAMP>`--enable-static'</SAMP> to only the packagesnamed <EM>libsnprintfv</EM> and <EM>autoopts</EM> in the current tree. Anyother packages configured would effectively be passed<SAMP>`--disable-static'</SAMP>. Note that this doesn't necessarily mean thatthe packages must honour these options. Enabling static libraries fora package which consists of only dynamic modules makes no sense, and thepackage author would probably have decided to ignore such requests,See section <A HREF="autobook_86.html#SEC86">11.1.2 Extra Macros for Libtool</A>.</P><P><DT><SAMP>`--enable-fast-install'</SAMP><DD>On some machines, <CODE>libtool</CODE> has to relink executables when theyare installed, See section <A HREF="autobook_81.html#SEC81">10.7 Installing an Executable</A>. Normally, when an enduser builds your package, they will probably type:<P><TABLE width=100%><tr><td> </td><td class=example bgcolor=#6688aa><br><pre>$ ./configure$ make$ make install</pre></td></tr></table></P><P><CODE>libtool</CODE> will build executables suitable for copying into theirrespective installation destinations, obviating the need for relinkingthem on those hosts which would have required it. Whenever<CODE>libtool</CODE> links an executable which uses shared libraries, italso creates a <EM>wrapper script</EM> which ensures that the environmentis correct for loading the correct libraries, See section <A HREF="autobook_79.html#SEC79">10.5 Executing Uninstalled Binaries</A>. On those hosts which require it, the wrapperscript will also relink the executable in the build tree if you attemptto run it from there before installation.</P><P>Sometimes this behaviour is not what you want, particularly if you aredeveloping the package and not installing between test compilations. Bypassing <SAMP>`--disable-fast-install'</SAMP>, the default behaviour isreversed; executables will be built so that they can be run from thebuild tree without relinking, but during installation they may berelinked.</P><P>You can pass a list of executables as the argument to<SAMP>`--enable-fast-install'</SAMP> to determine which set of executables willnot be relinked at installation time (on the hosts that require it). Byspecifying:</P><P><TABLE width=100%><tr><td> </td><td class=example bgcolor=#6688aa><br><pre>$ ./configure --enable-fast-install=autogen</pre></td></tr></table></P><P>The <CODE>autogen</CODE> executable will be linked for fast installation(without being relinked), and any other executables in the build treewill be linked for fast execution from their build location. This isuseful if the remaining executables are for testing only, and will neverbe installed.</P><P>Most machines do not require that executables be relinked in this way,and in these cases <CODE>libtool</CODE> will link each executable onceonly, no matter whether <SAMP>`--disable-fast-install'</SAMP> is used.</P><P><DT><SAMP>`--with-gnu-ld'</SAMP><DD><P>This option is used to inform <CODE>libtool</CODE> that the C compiler isusing GNU ld as its linker. It is more often used in the oppositesense when both <CODE>gcc</CODE> and GNU <CODE>ld</CODE> are installed,but <CODE>gcc</CODE> was built to use the native linker. <CODE>libtool</CODE>will probe the system for GNU ld, and assume that it is used by<CODE>gcc</CODE> if found, unless <SAMP>`--without-gnu-ld'</SAMP> is passed toconfigure.</P><P><DT><SAMP>`--disable-libtool-lock'</SAMP><DD><P>In normal operation, <CODE>libtool</CODE> will build two objects for everysource file in a package, one <EM>PIC</EM><A NAME="DOCF19" HREF="autobook_fot.html#FOOT19">(19)</A> and one non-PIC. With<CODE>gcc</CODE> and some other compilers, <CODE>libtool</CODE> can specify adifferent output location for the PIC object:</P><P><TABLE width=100%><tr><td> </td><td class=example bgcolor=#6688aa><br><pre>$ libtool gcc -c shell.cgcc -c -pic -DPIC shell.c -o .libs/shell.logcc -c foo.c -o shell.o >/dev/null 2>&1</pre></td></tr></table></P><P>When using a compiler that doesn't accept both <SAMP>`-o'</SAMP> and<SAMP>`-c'</SAMP> in the same command, <CODE>libtool</CODE> must compile firstthe PIC and then the non-PIC object to the same destination file andthen move the PIC object before compiling the non-PIC object. Thiswould be a problem for parallel builds, since one file might overwritethe other. <CODE>libtool</CODE> uses a simple shell locking mechanism toavoid this eventuality.</P><P>If you find yourself building in an environment that has such acompiler, and not using parallel <CODE>make</CODE>, then the lockingmechanism can be safely turned off by using<SAMP>`--disable-libtool-lock'</SAMP> to gain a little extra speed in theoverall compilation.</P><P><DT><SAMP>`--with-pic'</SAMP><DD>In normal operation, Libtool will build shared libraries from PICobjects and static archives from non-PIC objects, except where oneor the other is not provided by the target host. By specifying<SAMP>`--with-pic'</SAMP> you are asking <CODE>libtool</CODE> to build staticarchives from PIC objects, and similarly by specifying<SAMP>`--without-pic'</SAMP> you are asking <CODE>libtool</CODE> to build sharedlibraries from non-PIC objects.<P><CODE>libtool</CODE> will only honour this flag where it will produce aworking library, otherwise it reverts to the default.</DL><P><A NAME="Extra Macros for Libtool"></A></TR></TABLE><BR> <FONT SIZE="-1">This document was generatedby <I>Gary V. Vaughan</I> on <I>September, 12 2004</I>using <A HREF="http://www.mathematik.uni-kl.de/~obachman/Texi2html"><I>texi2html</I></A></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -