bash-inst.xml 3.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687
  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 commands 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 $LFS/static directory, which becomes
  28. the /static directory when chroot'ed or reboot'ed into
  29. LFS.</para></listitem>
  30. <listitem><para><userinput>--with-curses:</userinput> This option causes
  31. bash to be linked against the curses library instead of the default termcap
  32. library which is being phased out and has become obsolete. Note, on most
  33. all Linux systems, the curses library is provided by the Ncurses
  34. package (so in truth we link against the ncurses library).</para>
  35. <para>It is not strictly necessary for the static bash to be linked
  36. against libncurses (it can link against a static termcap for the time
  37. being just fine because we will reinstall Bash in Chapter 6 anyways,
  38. where we will use libncurses), but it's a good test to make sure that
  39. the Ncurses package has been installed properly. If not, you will get in
  40. trouble later on in this chapter when you install the Texinfo package.
  41. That package requires ncurses, and termcap can't reliably be used
  42. there.</para></listitem>
  43. </itemizedlist>
  44. <para>Now we can continue with compiling Bash:</para>
  45. <para><screen><userinput>make</userinput></screen></para>
  46. <para>And finish off the installation by installing Bash:</para>
  47. <para><screen><userinput>make install</userinput></screen></para>
  48. <para>If the <userinput>make install</userinput> phase ends with something
  49. along the lines of the following:</para>
  50. <blockquote><screen>install-info: unknown option `--dir-file=/mnt/lfs/usr/info/dir'
  51. usage: install-info [--version] [--help] [--debug] [--maxwidth=nnn]
  52. [--section regexp title] [--infodir=xxx] [--align=nnn]
  53. [--calign=nnn] [--quiet] [--menuentry=xxx]
  54. [--info-dir=xxx]
  55. [--keep-old] [--description=xxx] [--test]
  56. [--remove] [--] filename
  57. make[1]: *** [install] Error 1
  58. make[1]: Leaving directory `/mnt/lfs/usr/src/bash-&bash-version;/doc'
  59. make: [install] Error 2 (ignored)</screen></blockquote>
  60. <para>then that means that you are probably using Debian-2.2 (potato), and
  61. that you have an old version of the texinfo package and the info pages
  62. can't be installed at this time. This error is not a problem as the info
  63. pages will be installed when we recompile bash dynamically in Chapter 6, so
  64. you can ignore it. It is reported that the current release of Debian
  65. (3.0; also known as Woody) doesn't have this problem.</para>
  66. </sect2>