bash-inst.xml 3.8 KB

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