📄 diffutils.html
字号:
<HTML><HEAD><TITLE>Installing Diffutils-2.7</TITLE><METANAME="GENERATOR"CONTENT="Modular DocBook HTML Stylesheet Version 1.63"><LINKREL="HOME"TITLE="Linux From Scratch"HREF="../index.html"><LINKREL="UP"TITLE="Preparing the LFS system"HREF="../chapter05/chapter05.html"><LINKREL="PREVIOUS"TITLE="Installing Bzip2-1.0.1"HREF="../chapter05/bzip2.html"><LINKREL="NEXT"TITLE="Installing Fileutils-4.1"HREF="../chapter05/fileutils.html"></HEAD><BODYCLASS="sect1"BGCOLOR="#FFFFFF"TEXT="#000000"LINK="#0000FF"VLINK="#840084"ALINK="#0000FF"><DIVCLASS="NAVHEADER"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><THCOLSPAN="3"ALIGN="center">Linux From Scratch: Version 3.1</TH></TR><TR><TDWIDTH="10%"ALIGN="left"VALIGN="bottom"><AHREF="../chapter05/bzip2.html">Prev</A></TD><TDWIDTH="80%"ALIGN="center"VALIGN="bottom">Chapter 5. Preparing the LFS system</TD><TDWIDTH="10%"ALIGN="right"VALIGN="bottom"><AHREF="../chapter05/fileutils.html">Next</A></TD></TR></TABLE><HRALIGN="LEFT"WIDTH="100%"></DIV><DIVCLASS="sect1"><H1CLASS="sect1"><ANAME="ch05-diffutils">5.7. Installing Diffutils-2.7</A></H1><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen">Estimated build time: 1 minuteEstimated required disk space: 4 MB</PRE></FONT></TD></TR></TABLE><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN974">5.7.1. Installation of Diffutils</A></H2><P>When installing Diffutils using glibc-2.1.x on your base system, it may be necessary to use a fix to prevent a variable name conflict. Thefollowing commands can be used in this case. Note that these commandscan also be used for other glibc versions so if you aren't sure, thenuse the first version.</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>export CPPFLAGS=-Dre_max_failures=re_max_failures2 &&./configure --prefix=$LFS/usr &&unset CPPFLAGS &&make LDFLAGS=-static &&make install</B></TT></PRE></FONT></TD></TR></TABLE></P><P>If you are using a newer glibc version (2.2.x), you can use the followingcommands to install Diffutils:</P><P><TABLEBORDER="0"BGCOLOR="#E0E0E0"WIDTH="100%"><TR><TD><FONTCOLOR="#000000"><PRECLASS="screen"><TTCLASS="userinput"><B>./configure --prefix=$LFS/usr &&make LDFLAGS=-static &&make install</B></TT></PRE></FONT></TD></TR></TABLE></P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN984">5.7.2. Command explanations</A></H2><P><TTCLASS="userinput"><B>CPPFLAGS=-Dre_max_failures=re_max_failures2:</B></TT> TheCPPFLAGS variable is a variable that's read by the cpp program (C PreProcessor). The value of this variable tells the preprocessor to replace every instance of re_max_failures it finds by re_max_failures2 before handing the source file to the compiler itself for compilation. This package has problems linking statically on systems that run an olderGlibc version and this construction fixes that problem.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN988">5.7.3. Contents</A></H2><P>The Diffutils package contains the cmp, diff, diff3 and sdiff programs.</P></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN991">5.7.4. Description</A></H2><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN993">5.7.4.1. cmp and diff</A></H3><P>cmp and diff both compare two files and report their differences. Bothprograms have extra options which compare files in different situations.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN996">5.7.4.2. diff3</A></H3><P>The difference between diff and diff3 is that diff compares 2 files,diff3 compares 3 files.</P></DIV><DIVCLASS="sect3"><H3CLASS="sect3"><ANAME="AEN999">5.7.4.3. sdiff</A></H3><P>sdiff merges two files and interactively outputs the results.</P></DIV></DIV><DIVCLASS="sect2"><H2CLASS="sect2"><ANAME="AEN1002">5.7.5. Dependencies</A></H2><P>Diffutils-2.7 needs the following to beinstalled:</P><PCLASS="literallayout"><br>sh from the bash package<br><br>ld from the binutils package<br>as from the binutils package<br><br>chmod from the fileutils package<br>cp from the fileutils package<br>mv from the fileutils package<br>rm from the fileutils package<br><br>cc from the gcc package<br><br>egrep from the grep package<br>grep from the grep package<br><br>make from the make package<br><br>sed from the sed package<br><br>basename from the sh-utils package<br>date from the sh-utils package<br><br>cat from the textutils package<br>tr from the textutils package<br></P></DIV></DIV><DIVCLASS="NAVFOOTER"><HRALIGN="LEFT"WIDTH="100%"><TABLEWIDTH="100%"BORDER="0"CELLPADDING="0"CELLSPACING="0"><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top"><AHREF="../chapter05/bzip2.html">Prev</A></TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../index.html">Home</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top"><AHREF="../chapter05/fileutils.html">Next</A></TD></TR><TR><TDWIDTH="33%"ALIGN="left"VALIGN="top">Installing Bzip2-1.0.1</TD><TDWIDTH="34%"ALIGN="center"VALIGN="top"><AHREF="../chapter05/chapter05.html">Up</A></TD><TDWIDTH="33%"ALIGN="right"VALIGN="top">Installing Fileutils-4.1</TD></TR></TABLE></DIV></BODY></HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -