Running-Configure.html 7.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169
  1. <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
  2. <html>
  3. <!-- Copyright (C) 1988-2020 Free Software Foundation, Inc.
  4. Permission is granted to copy, distribute and/or modify this document
  5. under the terms of the GNU Free Documentation License, Version 1.3 or
  6. any later version published by the Free Software Foundation; with the
  7. Invariant Sections being "Free Software" and "Free Software Needs
  8. Free Documentation", with the Front-Cover Texts being "A GNU Manual,"
  9. and with the Back-Cover Texts as in (a) below.
  10. (a) The FSF's Back-Cover Text is: "You are free to copy and modify
  11. this GNU Manual. Buying copies from GNU Press supports the FSF in
  12. developing GNU and promoting software freedom." -->
  13. <!-- Created by GNU Texinfo 5.1, http://www.gnu.org/software/texinfo/ -->
  14. <head>
  15. <title>Debugging with GDB: Running Configure</title>
  16. <meta name="description" content="Debugging with GDB: Running Configure">
  17. <meta name="keywords" content="Debugging with GDB: Running Configure">
  18. <meta name="resource-type" content="document">
  19. <meta name="distribution" content="global">
  20. <meta name="Generator" content="makeinfo">
  21. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  22. <link href="index.html#Top" rel="start" title="Top">
  23. <link href="Concept-Index.html#Concept-Index" rel="index" title="Concept Index">
  24. <link href="index.html#SEC_Contents" rel="contents" title="Table of Contents">
  25. <link href="Installing-GDB.html#Installing-GDB" rel="up" title="Installing GDB">
  26. <link href="Separate-Objdir.html#Separate-Objdir" rel="next" title="Separate Objdir">
  27. <link href="Requirements.html#Requirements" rel="previous" title="Requirements">
  28. <style type="text/css">
  29. <!--
  30. a.summary-letter {text-decoration: none}
  31. blockquote.smallquotation {font-size: smaller}
  32. div.display {margin-left: 3.2em}
  33. div.example {margin-left: 3.2em}
  34. div.indentedblock {margin-left: 3.2em}
  35. div.lisp {margin-left: 3.2em}
  36. div.smalldisplay {margin-left: 3.2em}
  37. div.smallexample {margin-left: 3.2em}
  38. div.smallindentedblock {margin-left: 3.2em; font-size: smaller}
  39. div.smalllisp {margin-left: 3.2em}
  40. kbd {font-style:oblique}
  41. pre.display {font-family: inherit}
  42. pre.format {font-family: inherit}
  43. pre.menu-comment {font-family: serif}
  44. pre.menu-preformatted {font-family: serif}
  45. pre.smalldisplay {font-family: inherit; font-size: smaller}
  46. pre.smallexample {font-size: smaller}
  47. pre.smallformat {font-family: inherit; font-size: smaller}
  48. pre.smalllisp {font-size: smaller}
  49. span.nocodebreak {white-space:nowrap}
  50. span.nolinebreak {white-space:nowrap}
  51. span.roman {font-family:serif; font-weight:normal}
  52. span.sansserif {font-family:sans-serif; font-weight:normal}
  53. ul.no-bullet {list-style: none}
  54. -->
  55. </style>
  56. </head>
  57. <body lang="en" bgcolor="#FFFFFF" text="#000000" link="#0000FF" vlink="#800080" alink="#FF0000">
  58. <a name="Running-Configure"></a>
  59. <div class="header">
  60. <p>
  61. Next: <a href="Separate-Objdir.html#Separate-Objdir" accesskey="n" rel="next">Separate Objdir</a>, Previous: <a href="Requirements.html#Requirements" accesskey="p" rel="previous">Requirements</a>, Up: <a href="Installing-GDB.html#Installing-GDB" accesskey="u" rel="up">Installing GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  62. </div>
  63. <hr>
  64. <a name="Invoking-the-GDB-configure-Script"></a>
  65. <h3 class="section">C.2 Invoking the <small>GDB</small> <samp>configure</samp> Script</h3>
  66. <a name="index-configuring-GDB"></a>
  67. <p><small>GDB</small> comes with a <samp>configure</samp> script that automates the process
  68. of preparing <small>GDB</small> for installation; you can then use <code>make</code> to
  69. build the <code>gdb</code> program.
  70. </p>
  71. <p>The <small>GDB</small> distribution includes all the source code you need for
  72. <small>GDB</small> in a single directory, whose name is usually composed by
  73. appending the version number to &lsquo;<samp>gdb</samp>&rsquo;.
  74. </p>
  75. <p>For example, the <small>GDB</small> version 10.1.90.20201028-git distribution is in the
  76. <samp>gdb-10.1.90.20201028-git</samp> directory. That directory contains:
  77. </p>
  78. <dl compact="compact">
  79. <dt><code>gdb-10.1.90.20201028-git/configure <span class="roman">(and supporting files)</span></code></dt>
  80. <dd><p>script for configuring <small>GDB</small> and all its supporting libraries
  81. </p>
  82. </dd>
  83. <dt><code>gdb-10.1.90.20201028-git/gdb</code></dt>
  84. <dd><p>the source specific to <small>GDB</small> itself
  85. </p>
  86. </dd>
  87. <dt><code>gdb-10.1.90.20201028-git/bfd</code></dt>
  88. <dd><p>source for the Binary File Descriptor library
  89. </p>
  90. </dd>
  91. <dt><code>gdb-10.1.90.20201028-git/include</code></dt>
  92. <dd><p><small>GNU</small> include files
  93. </p>
  94. </dd>
  95. <dt><code>gdb-10.1.90.20201028-git/libiberty</code></dt>
  96. <dd><p>source for the &lsquo;<samp>-liberty</samp>&rsquo; free software library
  97. </p>
  98. </dd>
  99. <dt><code>gdb-10.1.90.20201028-git/opcodes</code></dt>
  100. <dd><p>source for the library of opcode tables and disassemblers
  101. </p>
  102. </dd>
  103. <dt><code>gdb-10.1.90.20201028-git/readline</code></dt>
  104. <dd><p>source for the <small>GNU</small> command-line interface
  105. </p></dd>
  106. </dl>
  107. <p>There may be other subdirectories as well.
  108. </p>
  109. <p>The simplest way to configure and build <small>GDB</small> is to run <samp>configure</samp>
  110. from the <samp>gdb-<var>version-number</var></samp> source directory, which in
  111. this example is the <samp>gdb-10.1.90.20201028-git</samp> directory.
  112. </p>
  113. <p>First switch to the <samp>gdb-<var>version-number</var></samp> source directory
  114. if you are not already in it; then run <samp>configure</samp>. Pass the
  115. identifier for the platform on which <small>GDB</small> will run as an
  116. argument.
  117. </p>
  118. <p>For example:
  119. </p>
  120. <div class="smallexample">
  121. <pre class="smallexample">cd gdb-10.1.90.20201028-git
  122. ./configure
  123. make
  124. </pre></div>
  125. <p>Running &lsquo;<samp>configure</samp>&rsquo; and then running <code>make</code> builds the
  126. included supporting libraries, then <code>gdb</code> itself. The configured
  127. source files, and the binaries, are left in the corresponding source
  128. directories.
  129. </p>
  130. <p><samp>configure</samp> is a Bourne-shell (<code>/bin/sh</code>) script; if your
  131. system does not recognize this automatically when you run a different
  132. shell, you may need to run <code>sh</code> on it explicitly:
  133. </p>
  134. <div class="smallexample">
  135. <pre class="smallexample">sh configure
  136. </pre></div>
  137. <p>You should run the <samp>configure</samp> script from the top directory in the
  138. source tree, the <samp>gdb-<var>version-number</var></samp> directory. If you run
  139. <samp>configure</samp> from one of the subdirectories, you will configure only
  140. that subdirectory. That is usually not what you want. In particular,
  141. if you run the first <samp>configure</samp> from the <samp>gdb</samp> subdirectory
  142. of the <samp>gdb-<var>version-number</var></samp> directory, you will omit the
  143. configuration of <samp>bfd</samp>, <samp>readline</samp>, and other sibling
  144. directories of the <samp>gdb</samp> subdirectory. This leads to build errors
  145. about missing include files such as <samp>bfd/bfd.h</samp>.
  146. </p>
  147. <p>You can install <code><small>GDB</small></code> anywhere. The best way to do this
  148. is to pass the <code>--prefix</code> option to <code>configure</code>, and then
  149. install it with <code>make install</code>.
  150. </p>
  151. <hr>
  152. <div class="header">
  153. <p>
  154. Next: <a href="Separate-Objdir.html#Separate-Objdir" accesskey="n" rel="next">Separate Objdir</a>, Previous: <a href="Requirements.html#Requirements" accesskey="p" rel="previous">Requirements</a>, Up: <a href="Installing-GDB.html#Installing-GDB" accesskey="u" rel="up">Installing GDB</a> &nbsp; [<a href="index.html#SEC_Contents" title="Table of contents" rel="contents">Contents</a>][<a href="Concept-Index.html#Concept-Index" title="Index" rel="index">Index</a>]</p>
  155. </div>
  156. </body>
  157. </html>