bash-inst.xml 3.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788
  1. <sect2><title>&nbsp;</title><para>&nbsp;</para></sect2>
  2. <sect2>
  3. <title>Installation of Bash</title>
  4. <para>Before you attempt to install Bash, you have to check to make sure
  5. your distribution has the <filename>/usr/lib/libcurses.a</filename> and
  6. <filename>/usr/lib/libncurses.a</filename> files. If your host
  7. distribution is an LFS system, all files will be present if you followed
  8. the instructions of the book version you read exactly.</para>
  9. <para>If both of the files are missing, you have to install the Ncurses
  10. development package. This package is often called something like
  11. <emphasis>ncurses-dev</emphasis> or <emphasis>ncurses-static</emphasis>. If
  12. this package is already installed, or you just installed it, check for the
  13. two files again. Often the <filename>libcurses.a</filename> file is (still)
  14. missing. If so, create <filename>libcurses.a</filename> as a symlink
  15. by running the following command as user <emphasis>root:</emphasis></para>
  16. <para><screen><userinput>ln -s libncurses.a /usr/lib/libcurses.a</userinput></screen></para>
  17. <para>Now we can really start. Prepare Bash to be compiled by running the
  18. following command:</para>
  19. <para><screen><userinput>./configure --enable-static-link \
  20. &nbsp;&nbsp;&nbsp;&nbsp;--prefix=$LFS/static --with-curses</userinput></screen></para>
  21. <para>The meaning of the configure options are:</para>
  22. <itemizedlist>
  23. <listitem><para><userinput>--enable-static-link</userinput>: This option
  24. causes the <userinput>bash</userinput> program to be statically
  25. linked.</para></listitem>
  26. <listitem><para><userinput>--prefix=$LFS/static</userinput>: This option
  27. installs all of Bash's files under the
  28. <filename class="directory">$LFS/static</filename> directory, which becomes
  29. the <filename class="directory">/static</filename> directory when chroot'ed
  30. or reboot'ed into LFS.</para></listitem>
  31. <listitem><para><userinput>--with-curses</userinput>: This option causes
  32. <filename>bash</filename> to be linked against the curses library instead
  33. of the default termcap library which has become obsolete. Note, on most
  34. all Linux systems, the curses library is provided by the Ncurses
  35. package (so in truth we link against the ncurses library).</para>
  36. <para>It is not strictly necessary for the static bash to be linked
  37. against libncurses (it can link against a static termcap for the time
  38. being just fine because we will reinstall Bash in Chapter 6 anyway,
  39. where we will use libncurses), but it's a good test to make sure that
  40. the Ncurses package has been installed properly. If not, you will get in
  41. trouble later on in this chapter when you install the Texinfo package.
  42. That package requires ncurses, and termcap can't be used
  43. there.</para></listitem>
  44. </itemizedlist>
  45. <para>Now we can continue with compiling Bash:</para>
  46. <para><screen><userinput>make</userinput></screen></para>
  47. <para>And finish off the installation by installing Bash:</para>
  48. <para><screen><userinput>make install</userinput></screen></para>
  49. <para>If the <userinput>make install</userinput> phase ends with something
  50. along the lines of the following:</para>
  51. <blockquote><screen>install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir'
  52. usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn]
  53. [--section regexp title] [--infodir=xxx] [--align=nnn]
  54. [--calign=nnn] [--quiet] [--menuentry=xxx]
  55. [--info-dir=xxx]
  56. [--keep-old] [--description=xxx] [--test]
  57. [--remove] [--] filename
  58. make[1]: *** [install] Error 1
  59. make[1]: Leaving directory `/mnt/lfs/usr/src/bash-&bash-version;/doc'
  60. make: [install] Error 2 (ignored)</screen></blockquote>
  61. <para>then that means that you are probably using Debian-2.2 (potato), and
  62. that you have an old version of the texinfo package and the info pages
  63. can't be installed at this time. This error is not a problem as the info
  64. pages will be installed when we recompile bash dynamically in Chapter 6, so
  65. you can ignore it. It is reported that the current release of Debian
  66. (3.0; also known as Woody) doesn't have this problem.</para>
  67. </sect2>